mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-03-04 22:31:23 +08:00
tabline: allow to show current buffer/tab at first position
This will make highlighting more consistent. Always first item is the one where the cursor is.
This commit is contained in:
@@ -111,6 +111,12 @@ endfunction
|
||||
function! s:get_visible_buffers()
|
||||
let buffers = airline#extensions#tabline#buflist#list()
|
||||
let cur = bufnr('%')
|
||||
if get(g:, 'airline#extensions#tabline#current_first', 0)
|
||||
if index(buffers, cur) > -1
|
||||
call remove(buffers, index(buffers, cur))
|
||||
endif
|
||||
let buffers = [cur] + buffers
|
||||
endif
|
||||
|
||||
let total_width = 0
|
||||
let max_width = 0
|
||||
|
||||
Reference in New Issue
Block a user