Skip to content

Commit cfa273d

Browse files
meliacheMatthewZMD
authored andcommitted
Fix regexp for vterm-filter-buffer-substring
The repetition regexp `\{3\}` needs a escape backslashes in Emacs: https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Backslash.html. And when writing the regexp as a string, you need to double the backslashes: https://stackoverflow.com/questions/538842/emacs-regular-expressions-in-lisp-need-to-be-double-escaped-why
1 parent 5084913 commit cfa273d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aidermacs-backend-vterm.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Use BUFFER if provided, otherwise retrieve it from `aidermacs-get-buffer-name'."
160160
"Filter text using ORIG-FUN with ARGS for cleaner vterm display.
161161
Converts multiple spaces to newlines and trims trailing whitespace."
162162
(let* ((text (apply orig-fun args))
163-
(space-fixed (replace-regexp-in-string "[ \t]{3,}" "\n" text))
163+
(space-fixed (replace-regexp-in-string "[ \t]\\{3\\}" "\n" text))
164164
(lines (split-string space-fixed "\n"))
165165
(clean-lines (mapcar #'string-trim-right lines))
166166
(fixed-text (string-join clean-lines "\n")))

0 commit comments

Comments
 (0)