diff options
| author | Justin Burkett <justin@burkett.cc> | 2017-05-11 12:38:23 -0400 |
|---|---|---|
| committer | Justin Burkett <justin@burkett.cc> | 2017-05-11 12:38:23 -0400 |
| commit | f00512006c889e4c8f97be3f34db4ee4aea15cff (patch) | |
| tree | 4e1d1d4715cdc4e4ec506de6567bd43dc15956d9 | |
| parent | f2204840ae73b414adf0df4efb7f00ac7837dca1 (diff) | |
Fix edge case with evil-search highlighting
With the ex command :s/^/ /, the pattern will match the beginning of the current
line and the next line in evil-ex-hl-update-highlights when it should only match
the beginning of the current line.
| -rw-r--r-- | evil-search.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/evil-search.el b/evil-search.el index 79090d1..49dadbd 100644 --- a/evil-search.el +++ b/evil-search.el @@ -634,7 +634,9 @@ The following properties are supported: ;; reusing old overlays (if possible) (while (and (not (eobp)) (evil-ex-search-find-next-pattern pattern) - (<= (match-end 0) end)) + (<= (match-end 0) end) + (not (and (= (match-end 0) end) + (string= pattern "^")))) (let ((ov (or (pop old-ovs) (make-overlay 0 0)))) (move-overlay ov (match-beginning 0) (match-end 0)) (overlay-put ov 'face face) |
