diff options
| author | Justin Burkett <justin@burkett.cc> | 2017-05-05 09:58:50 -0400 |
|---|---|---|
| committer | Justin Burkett <justin@burkett.cc> | 2017-05-05 09:58:50 -0400 |
| commit | a287186fb1ce17f2cd7beacc54f6babdcbcdbbe2 (patch) | |
| tree | b9ca165baa71fc2325824145d395d9a3786fb509 /evil-commands.el | |
| parent | 6a5ea185775900fd28a62f3c374f412aa832f5a0 (diff) | |
Reduce flickering due to multiple searches in evil-search-next
See #828
Diffstat (limited to 'evil-commands.el')
| -rw-r--r-- | evil-commands.el | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/evil-commands.el b/evil-commands.el index 38e483c..23b4fe3 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -2565,14 +2565,18 @@ for `isearch-forward',\nwhich lists available keys:\n\n%s" (search-string (if evil-regexp-search (car-safe regexp-search-ring) (car-safe search-ring)))) - (evil-search search-string isearch-forward evil-regexp-search) - (when (and (> (point) orig) - (save-excursion - (evil-adjust-cursor) - (= (point) orig))) - ;; Point won't move after first attempt and `evil-adjust-cursor' takes - ;; effect, so try again. - (evil-search search-string isearch-forward evil-regexp-search)) + (goto-char + ;; Wrap in `save-excursion' so that multiple searches have no visual effect. + (save-excursion + (evil-search search-string isearch-forward evil-regexp-search) + (when (and (> (point) orig) + (save-excursion + (evil-adjust-cursor) + (= (point) orig))) + ;; Point won't move after first attempt and `evil-adjust-cursor' takes + ;; effect, so start again. + (evil-search search-string isearch-forward evil-regexp-search)) + (point))) (when (and count (> count 1)) (dotimes (var (1- count)) (evil-search search-string isearch-forward evil-regexp-search))))) |
