mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-22 13:34:40 +02:00
searchcount: Ignore errors from searchcount() function
If the search regex causes an error, an ugly error message is thrown, so ignore errors in that case silently. closes #2216
This commit is contained in:
parent
ef4666bd86
commit
3a55368320
@ -18,6 +18,7 @@ function! airline#extensions#searchcount#apply(...) abort
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#searchcount#status() abort
|
||||
try
|
||||
let result = searchcount(#{recompute: 1, maxcount: -1})
|
||||
if empty(result) || result.total ==# 0
|
||||
return ''
|
||||
@ -36,4 +37,7 @@ function! airline#extensions#searchcount#status() abort
|
||||
endif
|
||||
return printf('%s[%d/%d]', @/,
|
||||
\ result.current, result.total)
|
||||
catch
|
||||
return ''
|
||||
endtry
|
||||
endfunction
|
||||
|
Loading…
x
Reference in New Issue
Block a user