mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-08-12 10:52:35 +08:00
whitespace: verify existence of searchcount() function before using it
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
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:
@@ -8,6 +8,7 @@ scriptencoding utf-8
|
|||||||
let s:show_message = get(g:, 'airline#extensions#whitespace#show_message', 1)
|
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:symbol = get(g:, 'airline#extensions#whitespace#symbol', g:airline_symbols.whitespace)
|
||||||
let s:default_checks = ['indent', 'trailing', 'mixed-indent-file', 'conflicts']
|
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:enabled = get(g:, 'airline#extensions#whitespace#enabled', 1)
|
||||||
let s:skip_check_ft = {'make': ['indent', 'mixed-indent-file'],
|
let s:skip_check_ft = {'make': ['indent', 'mixed-indent-file'],
|
||||||
@@ -63,6 +64,9 @@ function! s:conflict_marker()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:conflict_marker_count()
|
function! s:conflict_marker_count()
|
||||||
|
if !s:searchcount
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
" Checks for git conflict markers
|
" Checks for git conflict markers
|
||||||
" space required for jj conflict marker: #2727
|
" space required for jj conflict marker: #2727
|
||||||
let annotation = '\%([0-9A-Za-z_.: ]\+\)\?'
|
let annotation = '\%([0-9A-Za-z_.: ]\+\)\?'
|
||||||
|
|||||||
Reference in New Issue
Block a user