Skip to content

Commit

Permalink
Don't error if a buffer is completely unnamed
Browse files Browse the repository at this point in the history
Looks like the QuickFix window buffer isn't properly named, and in a way
somehow different from other unnamed buffers.  Don't crash if we can't
figure out the name.

Thanks to Marco Barberis.
  • Loading branch information
sjbach committed Jun 1, 2010
1 parent af97bca commit 0746c00
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lusty-juggler.vim
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,11 @@ class BufferStack
end

def buf_name(i)
eva("bufname(#{i})")
if VIM::nonzero? eva("empty(bufname(#{i}))")
"<Unknown #{i}>"
else
eva("bufname(#{i})")
end
end

def shorten_paths(buffer_names)
Expand Down

0 comments on commit 0746c00

Please sign in to comment.