From 6766a222edf5f715e3c63c2cb2b8944d84026349 Mon Sep 17 00:00:00 2001 From: liangfeng Date: Fri, 21 Jun 2013 22:34:48 +0800 Subject: [PATCH 1/4] Add toggle support. --- plugin/tasklist.vim | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/plugin/tasklist.vim b/plugin/tasklist.vim index 25e9e73..a2caf1f 100644 --- a/plugin/tasklist.vim +++ b/plugin/tasklist.vim @@ -183,7 +183,7 @@ function! s:SearchFile(hits, word) if foldlevel(l:curr_line) != 0 normal! 99zo endif - if l:div == 0 + if l:div == 0 if a:hits != 0 let @z = @z."\n" endif @@ -322,7 +322,8 @@ function! s:TaskList() echo "tasklist.vim: No task information found." echohl None execute 'normal! '.l:original_line.'G' - return + " -1 means there is no task info found. + return -1 endif " display window @@ -364,12 +365,36 @@ endfunction " Command command! TaskList call s:TaskList() +" Comment out below key map to avoid conflict with tagbar. " Default key map -if !hasmapto('TaskList') - map t TaskList -endif +" if !hasmapto('TaskList') +" map t TaskList +" endif " Key map to Command nnoremap