From af96e9745fe5f41c68b4643797bc85488b1eccec Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Tue, 20 Aug 2019 14:28:54 +0200 Subject: [PATCH] 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) --- autoload/airline/extensions/wordcount.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autoload/airline/extensions/wordcount.vim b/autoload/airline/extensions/wordcount.vim index a8174f7f..6f731b1f 100644 --- a/autoload/airline/extensions/wordcount.vim +++ b/autoload/airline/extensions/wordcount.vim @@ -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