diff options
| author | Justin Burkett <justin@burkett.cc> | 2017-05-01 21:45:30 -0400 |
|---|---|---|
| committer | Justin Burkett <justin@burkett.cc> | 2017-05-11 12:10:12 -0400 |
| commit | aef5088601d86c8d8d1008036d95079490bfcbba (patch) | |
| tree | cff01f5a1f7f64db345379d9a0e238b2b8520a50 /evil-search.el | |
| parent | 2fc4241b7b157e6375c6fdc9af052798f90484a5 (diff) | |
Fix highlighting of multi-line substitute patterns
evil-ex-hl-update-highlights was adding an extra forward-line for patterns that
contained newlines in them, causing every other match to be highlighted.
e.g., :%s/C-qC-j/a/
Note that with the g flag there was no problem
because (evil-ex-pattern-whole-line pattern) was non-nil.
See #824
Diffstat (limited to 'evil-search.el')
| -rw-r--r-- | evil-search.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/evil-search.el b/evil-search.el index 0a52114..79090d1 100644 --- a/evil-search.el +++ b/evil-search.el @@ -643,7 +643,10 @@ The following properties are supported: (push ov new-ovs) (when match-hook (funcall match-hook hl ov))) (cond - ((not (evil-ex-pattern-whole-line pattern)) + ((and (not (evil-ex-pattern-whole-line pattern)) + (not (string-match-p "\n" (buffer-substring-no-properties + (match-beginning 0) + (match-end 0))))) (forward-line)) ((= (match-beginning 0) (match-end 0)) (forward-char)) |
