Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions plugin/minibufexpl.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,8 @@ function! <SID>BuildBufferList(curBufNum)

if t:miniBufExplSortBy == "name"
call sort(l:tabList, "<SID>NameCmp")
elseif t:miniBufExplSortBy == "number"
call sort(l:tabList, "<SID>NumberCmp")
elseif t:miniBufExplSortBy == "mru"
call sort(l:tabList, "<SID>MRUCmp")
endif
Expand Down Expand Up @@ -1976,6 +1978,21 @@ function! <SID>UpdateBufferStateDict(bufNum,deleted)
call <SID>DEBUG('Leaving UpdateBufferStateDict()',10)
endfunction

" }}}
" NumberCmp - compares tabs based on filename {{{
"
function! <SID>NumberCmp(tab1, tab2)
let l:name1 = str2nr(matchstr(a:tab1, '[0-9]\+'))
let l:name2 = str2nr(matchstr(a:tab2, '[0-9]\+'))
if l:name1 < l:name2
return -1
elseif l:name1 > l:name2
return 1
else
return 0
endif
endfunction

" }}}
" NameCmp - compares tabs based on filename {{{
"
Expand Down