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

Allow zooming the window

This commit is contained in:
Jan Larres
2011-01-20 21:20:29 +13:00
parent a5fd8d2c75
commit 8d72cedc41

View File

@@ -185,6 +185,7 @@ function! s:OpenWindow()
" Variable for saving the current file for functions that are called from
" the tagbar window
let s:current_file = ''
let s:is_maximized = 0
syntax match Comment '^" .*' " Comments
syntax match Identifier '^[^: ]\+$' " Non-scoped kinds
@@ -206,6 +207,7 @@ function! s:OpenWindow()
nnoremap <script> <silent> <buffer> <2-LeftMouse>
\ :call <SID>JumpToTag()<CR>
nnoremap <script> <silent> <buffer> <Space> :call <SID>ShowPrototype()<CR>
nnoremap <script> <silent> <buffer> x :call <SID>ZoomWindow()<CR>
nnoremap <script> <silent> <buffer> q :close<CR>
augroup TagbarAutoCmds
@@ -250,6 +252,16 @@ function! s:CloseWindow()
endif
endfunction
function! s:ZoomWindow()
if s:is_maximized
execute 'vert resize ' . g:tagbar_width
let s:is_maximized = 0
else
vert resize
let s:is_maximized = 1
endif
endfunction
function! s:CleanUp()
silent! autocmd! TagbarAutoCmds
endfunction