From 4d5b30b1cec2ec2437c07c0329125b66a5562e54 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Sat, 9 Apr 2011 03:33:59 +1200 Subject: [PATCH] Fix statusline bug when opening Tagbar without having a valid file loaded --- plugin/tagbar.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/tagbar.vim b/plugin/tagbar.vim index cd2c974..91a3479 100644 --- a/plugin/tagbar.vim +++ b/plugin/tagbar.vim @@ -2435,8 +2435,10 @@ function! TagbarGenerateStatusline() let text = '[Order]' endif - let filename = fnamemodify(s:known_files.getCurrent().fpath, ':t') - let text .= ' ' . filename + if !empty(s:known_files.getCurrent()) + let filename = fnamemodify(s:known_files.getCurrent().fpath, ':t') + let text .= ' ' . filename + endif return text endfunction