whitespace: verify existence of searchcount() function before using it
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2025-12-23 12:50:35 +01:00
parent 72acbef146
commit b03fdc542f

View File

@@ -8,6 +8,7 @@ scriptencoding utf-8
let s:show_message = get(g:, 'airline#extensions#whitespace#show_message', 1)
let s:symbol = get(g:, 'airline#extensions#whitespace#symbol', g:airline_symbols.whitespace)
let s:default_checks = ['indent', 'trailing', 'mixed-indent-file', 'conflicts']
let s:searchcount = exists('*searchcount')
let s:enabled = get(g:, 'airline#extensions#whitespace#enabled', 1)
let s:skip_check_ft = {'make': ['indent', 'mixed-indent-file'],
@@ -63,6 +64,9 @@ function! s:conflict_marker()
endfunction
function! s:conflict_marker_count()
if !s:searchcount
return 0
endif
" Checks for git conflict markers
" space required for jj conflict marker: #2727
let annotation = '\%([0-9A-Za-z_.: ]\+\)\?'