1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-18 03:50:26 +01:00

Support using the mouse for opening/closing folds

This commit is contained in:
Jan Larres
2011-03-28 00:34:50 +13:00
parent 17064c6978
commit 0c39715fa7

View File

@@ -783,6 +783,8 @@ function! s:MapKeys()
nnoremap <script> <silent> <buffer> <CR> :call <SID>JumpToTag()<CR>
nnoremap <script> <silent> <buffer> <2-LeftMouse>
\ :call <SID>JumpToTag()<CR>
nnoremap <script> <silent> <buffer> <LeftRelease>
\ <LeftRelease>:call <SID>CheckMouseClick()<CR>
nnoremap <script> <silent> <buffer> <Space> :call <SID>ShowPrototype()<CR>
nnoremap <script> <silent> <buffer> + :call <SID>OpenFold()<CR>
@@ -2213,6 +2215,18 @@ function! s:GetTagInfo(linenr, ignorepseudo)
return taginfo
endfunction
" s:CheckMouseClick() {{{2
function! s:CheckMouseClick()
let curchar = strpart(getline('.'), col('.') - 1, 1)
let nextchar = strpart(getline('.'), col('.'), 1)
if curchar =~# '-' && nextchar =~# '[-+ ]'
call s:CloseFold()
elseif curchar =~# '+' && nextchar =~# '[-+ ]'
call s:OpenFold()
endif
endfunction
" TagbarBalloonExpr() {{{2
function! TagbarBalloonExpr()
let taginfo = s:GetTagInfo(v:beval_lnum, 1)