1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Fix incorrect regular expression for more general text replacements.

* lisp/progmodes/hideif.el (hif-evaluate-macro): fix regexp to trim
  off leading/trailing spaces, but not within.
This commit is contained in:
Luke Lee 2021-03-31 11:22:47 +08:00
parent 571c261525
commit 8ac3132957

View file

@ -1600,7 +1600,7 @@ not be expanded."
(result (funcall hide-ifdef-evaluator expr))
(exprstring (replace-regexp-in-string
;; Trim off leading/trailing whites
"^[ \t]*\\([^ \t]+\\)[ \t]*" "\\1"
"^[ \t]*\\|[ \t]*$" ""
(replace-regexp-in-string
"\\(//.*\\)" "" ; Trim off end-of-line comments
(buffer-substring-no-properties start end)))))