Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Create temporary fix for Tagbar segment

This update adds a wrapper function that checks if Tagbar is loaded
before trying to call `tagbar#currenttag()`. Unfortunately this only
works *after* Tagbar has been opened, so the Tagbar/current tag segment
will be empty until Tagbar has been opened for the first time.

Refs #152.
Refs majutsushi/tagbar#77.
  • Loading branch information...
commit 088978793b9ecdb4df7920e2cbc44c925e96c264 1 parent b00b5b0
@Lokaltog Lokaltog authored committed
Showing with 11 additions and 0 deletions.
  1. +11 −0 autoload/Powerline/Functions/tagbar.vim
View
11 autoload/Powerline/Functions/tagbar.vim
@@ -0,0 +1,11 @@
+function! Powerline#Functions#tagbar#GetTag() " {{{
+ " Wrapper function that checks if Tagbar is loaded to avoid errors when
+ " Tagbar is loaded after Powerline
+ let ret = ''
+
+ if exists('g:loaded_tagbar') && g:loaded_tagbar == 1
+ let ret = tagbar#currenttag('%s', '')
+ endif
+
+ return ret
+endfunction " }}}
Please sign in to comment.
Something went wrong with that request. Please try again.