mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-23 22:15:28 +02:00
wordcount: only try to access buffer content in the actual current buffer
closes #1955 (this actually needs Vim patch 8.1.1372 to work properly)
This commit is contained in:
parent
3f82d3a975
commit
af96e9745f
@ -6,6 +6,9 @@ scriptencoding utf-8
|
|||||||
" get wordcount {{{1
|
" get wordcount {{{1
|
||||||
if exists('*wordcount')
|
if exists('*wordcount')
|
||||||
function! s:get_wordcount(visual_mode_active)
|
function! s:get_wordcount(visual_mode_active)
|
||||||
|
if get(g:, 'actual_curbuf', '') != bufnr('')
|
||||||
|
return
|
||||||
|
endif
|
||||||
let query = a:visual_mode_active ? 'visual_words' : 'words'
|
let query = a:visual_mode_active ? 'visual_words' : 'words'
|
||||||
return get(wordcount(), query, 0)
|
return get(wordcount(), query, 0)
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user