You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently I experienced an issue multiple times. When I search something and there is no match in the current buffer, then search highlight is not cleared even if I move the cursor.
Open Vim and search anything, for example, /test. Then we'll see E486: Pattern not found: test error. Just insert that text, test to the buffer. Then it'll be immediately highlighted. If I turn off the search highlight, I need to type :noh or search that term again and move the cursor.
This issue is clearer when there are multiple windows open. One having no match, and the other having one match or more. If the current buffer doesn't have a match, then the search highlight of the other is not cleared when I move the cursor.
The text was updated successfully, but these errors were encountered:
Thanks, I can reproduce. Vim stops processing the rest of the sequence on error (see :help map-error), so that's why in that case slash fails to register the autocmd for clearing the search highlight.
gd also has the same issue. If you press gd on the first occurrence of a keyword, it will fail and highlighting will remain. Unfortunately, I'm not aware of a solution to the problem.
Recently I experienced an issue multiple times. When I search something and there is no match in the current buffer, then search highlight is not cleared even if I move the cursor.
This is the minimal vimrc to reproduce:
Open Vim and search anything, for example,
/test
. Then we'll seeE486: Pattern not found: test
error. Just insert that text,test
to the buffer. Then it'll be immediately highlighted. If I turn off the search highlight, I need to type:noh
or search that term again and move the cursor.This issue is clearer when there are multiple windows open. One having no match, and the other having one match or more. If the current buffer doesn't have a match, then the search highlight of the other is not cleared when I move the cursor.
The text was updated successfully, but these errors were encountered: