diff --git a/doc/tagbar.txt b/doc/tagbar.txt index ffa58fa..f7a14de 100644 --- a/doc/tagbar.txt +++ b/doc/tagbar.txt @@ -262,7 +262,8 @@ These mappings are valid in the Tagbar window: p Jump to the tag under the cursor, but stay in the Tagbar window. When on a fold icon, open or close the fold depending on the current state. -<2-LeftMouse> Same as . +<2-LeftMouse> Same as . See |g:tagbar_singleclick| if you want to use a + single- instead of a double-click. Display the prototype of the current tag (i.e. the line defining it) in the command line. +/zo Open the fold under the cursor. @@ -379,6 +380,18 @@ Example: let g:tagbar_expand = 1 < + *g:tagbar_singleclick* +g:tagbar_singleclick~ +Default: 0 + +If this option is set then a single- instead of a double-click is used to jump +to the tag definition. + +Example: +> + let g:tagbar_singleclick = 1 +< + *g:tagbar_foldlevel* g:tagbar_foldlevel~ Default: 99 diff --git a/plugin/tagbar.vim b/plugin/tagbar.vim index 978788a..31caa70 100644 --- a/plugin/tagbar.vim +++ b/plugin/tagbar.vim @@ -97,6 +97,10 @@ if !exists('g:tagbar_expand') let g:tagbar_expand = 0 endif +if !exists('g:tagbar_singleclick') + let g:tagbar_singleclick = 0 +endif + if !exists('g:tagbar_foldlevel') let g:tagbar_foldlevel = 99 endif @@ -2788,6 +2792,8 @@ function! s:CheckMouseClick() call s:CloseFold() elseif (match(line, s:icon_closed . '[-+ ]') + 1) == curcol call s:OpenFold() + elseif g:tagbar_singleclick + call s:JumpToTag(0) endif endfunction