Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reserve space for flags in VSplit mode #153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
13 changes: 12 additions & 1 deletion plugin/minibufexpl.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,8 @@ function! <SID>BuildBufferList(curBufNum)
let l:tab .= s:bufUniqNameDict[l:i]
let l:tab .= ']'

let l:tabWidth = strlen(l:tab)

" If the buffer is open in a window mark it
if bufwinnr(l:i) != -1
let l:tab .= '*'
Expand All @@ -1537,7 +1539,16 @@ function! <SID>BuildBufferList(curBufNum)
let l:tab .= '!'
endif

let l:maxTabWidth = strlen(l:tab) > l:maxTabWidth ? strlen(l:tab) : l:maxTabWidth
if g:miniBufExplVSplit == 0
" in normal mode, take the actual width as the TabWidth
let l:tabWidth = strlen(l:tab)
else
" in VSplit mode, use the potentially maximal width of a tab
" i.e. the tab content plus space for all the possible flags
let l:tabWidth = l:tabWidth + 3
endif

let l:maxTabWidth = l:tabWidth > l:maxTabWidth ? l:tabWidth : l:maxTabWidth

call add(l:tabList, l:tab)
endfor
Expand Down