Skip to content

Commit

Permalink
fix potential infinite loop when entering help files
Browse files Browse the repository at this point in the history
  • Loading branch information
bling committed Jun 8, 2013
1 parent 963d484 commit 318c77c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugin/bufferline.vim
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,16 @@ function! s:generate_names()
endfunction

function! bufferline#generate_string()
" check for special cases like help files
let current = bufnr('%')
if !bufexists(current) || !buflisted(current)
return bufname('%')
endif

let names = s:generate_names()

" force active buffer to be second in line always and wrap the others
if g:bufferline_rotate && len(names) > 1
let current = bufnr('%')
while names[1][0] != current
let first = remove(names, 0)
call add(names, first)
Expand Down

0 comments on commit 318c77c

Please sign in to comment.