Permalink
Browse files

Add auto-previewing mode, closes #161

  • Loading branch information...
1 parent 2d650b9 commit 0377f19d7479a5387f89ff1b14d11abb874b1ea6 @majutsushi committed Nov 11, 2013
Showing with 17 additions and 0 deletions.
  1. +4 −0 autoload/tagbar.vim
  2. +12 −0 doc/tagbar.txt
  3. +1 −0 plugin/tagbar.vim
View
@@ -967,6 +967,10 @@ function! s:CreateAutocommands() abort
autocmd WinEnter __Tagbar__ call s:SetStatusLine('current')
autocmd WinLeave __Tagbar__ call s:SetStatusLine('noncurrent')
+ if g:tagbar_autopreview
+ autocmd CursorMoved __Tagbar__ nested call s:ShowInPreviewWin()
+ endif
+
autocmd WinEnter * if bufwinnr('__Tagbar__') == -1 |
\ call s:ShrinkIfExpanded() |
\ endif
View
@@ -564,6 +564,18 @@ Example:
let g:tagbar_autoshowtag = 1
<
+ *g:tagbar_autopreview*
+g:tagbar_autopreview~
+Default: 0
+
+If this variable is set to 1 then moving the cursor in the Tagbar window will
+automatically show the current tag in the preview window.
+
+Example:
+>
+ let g:tagbar_autopreview = 1
+<
+
*g:tagbar_updateonsave_maxlines*
g:tagbar_updateonsave_maxlines~
View
@@ -51,6 +51,7 @@ endfunction
let s:options = [
\ ['autoclose', 0],
\ ['autofocus', 0],
+ \ ['autopreview', 0],
\ ['autoshowtag', 0],
\ ['compact', 0],
\ ['expand', 0],

0 comments on commit 0377f19

Please sign in to comment.