From 45cab177ef44334a504d9f07ec589d8c3a66e36b Mon Sep 17 00:00:00 2001 From: zdm Date: Thu, 22 May 2014 12:29:35 +0300 Subject: [PATCH] always use absolute file path when comparing buffers names --- .../airline/extensions/tabline/unique_tail_improved.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/airline/extensions/tabline/unique_tail_improved.vim b/autoload/airline/extensions/tabline/unique_tail_improved.vim index 6b13dcf..3590fbb 100644 --- a/autoload/airline/extensions/tabline/unique_tail_improved.vim +++ b/autoload/airline/extensions/tabline/unique_tail_improved.vim @@ -14,9 +14,9 @@ function! airline#extensions#tabline#unique_tail_improved#format(bufnr, buffers) for nr in a:buffers let name = bufname(nr) - if !empty(name) && nr != a:bufnr && fnamemodify(name, ':t') == curbuf_tail + if !empty(name) && nr != a:bufnr && fnamemodify(name, ':t') == curbuf_tail " only perform actions if curbuf_tail isn't unique let do_deduplicate = 1 - let tokens = reverse(split(substitute(fnamemodify(name, ':p:.:h'), '\\', '/', 'g'), '/')) + let tokens = reverse(split(substitute(fnamemodify(name, ':p:h'), '\\', '/', 'g'), '/')) let token_index = 0 for token in tokens if token == '' | continue | endif @@ -33,7 +33,7 @@ function! airline#extensions#tabline#unique_tail_improved#format(bufnr, buffers) if do_deduplicate == 1 let path = [] let token_index = 0 - for token in reverse(split(substitute(fnamemodify(bufname(a:bufnr), ':p:.:h'), '\\', '/', 'g'), '/')) + for token in reverse(split(substitute(fnamemodify(bufname(a:bufnr), ':p:h'), '\\', '/', 'g'), '/')) if token == '.' | break | endif let duplicated = 0 let uniq = 1