From d94b7ad66f1e63c14f4d51af3ace0189a4351968 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Thu, 20 Jan 2011 18:16:57 +1300 Subject: [PATCH] Allow toggling the sort method --- plugin/tagbar.vim | 80 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 64 insertions(+), 16 deletions(-) diff --git a/plugin/tagbar.vim b/plugin/tagbar.vim index 1cb7e4f..2f4fcb2 100644 --- a/plugin/tagbar.vim +++ b/plugin/tagbar.vim @@ -62,8 +62,9 @@ function! s:InitTypes() " complete path. " The entries are again dictionaries with the following fields: " - mtime: File modification time - " - tags: List of the tags that are present in the file, sorted according - " to the value of 'g:tagbar_sort' + " - 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 let s:known_files = {} @@ -181,6 +182,10 @@ function! s:OpenWindow() setlocal foldcolumn=1 setlocal foldtext=v:folddashes.getline(v:foldstart) + " Variable for saving the current file for functions that are called from + " the tagbar window + let s:current_file = '' + syntax match Comment '^" .*' " Comments syntax match Identifier '^[^: ]\+$' " Non-scoped kinds syntax match Title '[^:(* ]\+\ze\*\? :' " Scope names @@ -191,7 +196,7 @@ function! s:OpenWindow() let cpoptions_save = &cpoptions set cpoptions&vim -" nnoremap