mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-23 02:16:12 +08:00
Merge pull request #527 from zdm/master
Always use absolute file path when comparing buffers names
This commit is contained in:
commit
3ab1bb7eb0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user