From b03fdc542f5155b54959102a2aecaf6c792dce01 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Tue, 23 Dec 2025 12:50:35 +0100 Subject: [PATCH] whitespace: verify existence of searchcount() function before using it Signed-off-by: Christian Brabandt --- autoload/airline/extensions/whitespace.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autoload/airline/extensions/whitespace.vim b/autoload/airline/extensions/whitespace.vim index 3b0becfc..0da40038 100644 --- a/autoload/airline/extensions/whitespace.vim +++ b/autoload/airline/extensions/whitespace.vim @@ -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_.: ]\+\)\?'