mirror of
https://github.com/vim-airline/vim-airline
synced 2025-02-20 12:36:58 +00: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
|
||||
if exists('*wordcount')
|
||||
function! s:get_wordcount(visual_mode_active)
|
||||
if get(g:, 'actual_curbuf', '') != bufnr('')
|
||||
return
|
||||
endif
|
||||
let query = a:visual_mode_active ? 'visual_words' : 'words'
|
||||
return get(wordcount(), query, 0)
|
||||
endfunction
|
||||
|
Loading…
Reference in New Issue
Block a user