Skip to content

Commit 6cd1a0d

Browse files
committed
Avoid errors in search call
If the user uses an invalid search query (for example "\(", which has an unmatched '('), then the searchcount() call will throw an error. Since the statusline is evaluated regularly, this would then spam the cmdline messages with the same error over and over again (E54 in the above case). We can safely suppress errors here, because the user will still get notified of invalid queries when doing the initial search. In the error case searchcount() will return a result that represents "0/0" search results, so we don't need to do any further error handling
1 parent bff2124 commit 6cd1a0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/tpipeline/stl.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func tpipeline#stl#searchc()
3434
if !v:hlsearch
3535
return ''
3636
endif
37-
let result = searchcount()
37+
silent! let result = searchcount()
3838
if empty(result) || result.incomplete ==#1
3939
return ''
4040
endif

0 commit comments

Comments
 (0)