From 140c7c84c827acc4139ce84e2428868dabff27d7 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Fri, 8 Apr 2011 01:00:12 +1200 Subject: [PATCH] Refactor into a more object-oriented style and make folding more vim-like --- plugin/tagbar.vim | 890 ++++++++++++++++++++++++++-------------------- 1 file changed, 511 insertions(+), 379 deletions(-) diff --git a/plugin/tagbar.vim b/plugin/tagbar.vim index adf3134..c45e089 100644 --- a/plugin/tagbar.vim +++ b/plugin/tagbar.vim @@ -102,25 +102,14 @@ let s:type_init_done = 0 let s:autocommands_done = 0 let s:window_expanded = 0 +let s:access_symbols = { + \ 'public' : '+', + \ 'protected' : '#', + \ 'private' : '-' +\ } + " s:InitTypes() {{{2 function! s:InitTypes() - " Dictionary of the already processed files, indexed by file name with - " complete path. - " The entries are again dictionaries with the following fields: - " - fpath: The complete file path - " - mtime: File modification time - " - ftype: The vim file type - " - tags: List of the tags that are present in the file, sorted - " according to the value of 'g:tagbar_sort' - " - fline: Dictionary of the tags, indexed by line number in the file - " - tline: Dictionary of the tags, indexed by line number in the tagbar - " - kindfolds: Dictionary of the folding state of 'kind's, indexed by short - " name - " - tagfolds: Dictionary of dictionaries of the folding state of - " individual tags, indexed by kind and full path - " - foldlevel: The current foldlevel of the file - let s:known_files = {} - let s:known_types = {} " Ant {{{3 @@ -744,12 +733,6 @@ function! s:InitTypes() endfor endfor - let s:access_symbols = { - \ 'public' : '+', - \ 'protected' : '#', - \ 'private' : '-' - \ } - let s:type_init_done = 1 endfunction @@ -814,24 +797,21 @@ function! s:MapKeys() nnoremap