mirror of
https://github.com/preservim/tagbar.git
synced 2025-02-08 12:53:59 +08:00
Allow single-click for jumping to a tag, closes #16
This commit is contained in:
parent
9d5af93a5b
commit
7aa936dc9c
|
@ -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.
|
||||
<LeftMouse> When on a fold icon, open or close the fold depending on the
|
||||
current state.
|
||||
<2-LeftMouse> Same as <CR>.
|
||||
<2-LeftMouse> Same as <CR>. See |g:tagbar_singleclick| if you want to use a
|
||||
single- instead of a double-click.
|
||||
<Space> 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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user