Fix buffer order in tabline with CtrlSpace plugin

This commit is contained in:
MuhammadMouradG 2020-10-06 12:36:28 +00:00 committed by GitHub
parent 9614105d09
commit f117de553b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,15 @@ endfunction
function! airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, pull_right) function! airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, pull_right)
let pos_extension = (a:pull_right ? '_right' : '') let pos_extension = (a:pull_right ? '_right' : '')
let buffer_list = ctrlspace#api#BufferList(a:cur_tab)
let buffer_list = []
for bufferindex in sort(keys(ctrlspace#api#Buffers(a:cur_tab)), 'N')
for buffer in ctrlspace#api#BufferList(a:cur_tab)
if buffer['index'] == bufferindex
call add(buffer_list, buffer)
endif
endfor
endfor
" add by tenfy(tenfyzhong@qq.com) " add by tenfy(tenfyzhong@qq.com)
" if the current buffer no in the buffer list " if the current buffer no in the buffer list