From ce58af719109f83f965b1d8b87232b8161fcfe90 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 7 Feb 2015 15:26:03 +0100 Subject: [PATCH] Fix get_buffer_list being called always via get() Vim's `get()` calls the expression for `{default}` always, not only if the default is going to be used! This caused `airline#extensions#tabline#get_buffer_name` to not use the cached value. Fixes https://github.com/bling/vim-airline/issues/697. --- autoload/airline/extensions/tabline.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index 4681a2a4..a761107a 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -130,7 +130,10 @@ function! airline#extensions#tabline#title(n) endfunction function! airline#extensions#tabline#get_buffer_name(nr) - return airline#extensions#tabline#{s:formatter}#format(a:nr, get(s:, 'current_buffer_list', s:get_buffer_list())) + let buffer_list = exists('s:current_buffer_list') + \ ? s:current_buffer_list + \ : s:get_buffer_list() + return airline#extensions#tabline#{s:formatter}#format(a:nr, buffer_list) endfunction function! s:get_buffer_list()