diff --git a/plugin/tasklist.vim b/plugin/tasklist.vim index 25e9e73..0f55cac 100644 --- a/plugin/tasklist.vim +++ b/plugin/tasklist.vim @@ -134,9 +134,9 @@ endif function! s:OpenWindow(buffnr, lineno) " Open results window and place items there. if g:tlWindowPosition == 0 - execute 'sp -TaskList_'.a:buffnr.'-' + execute 'silent sp -TaskList_'.a:buffnr.'-' else - execute 'botright sp -TaskList_'.a:buffnr.'-' + execute 'silent botright sp -TaskList_'.a:buffnr.'-' endif let b:original_buffnr = a:buffnr @@ -144,7 +144,7 @@ function! s:OpenWindow(buffnr, lineno) set noswapfile set modifiable - normal! "zPGddgg + silent normal! "zPGddgg set fde=getline(v:lnum)[0]=='L' set foldmethod=expr set foldlevel=0 @@ -159,6 +159,7 @@ function! s:OpenWindow(buffnr, lineno) " Clean up. let @z = "" set nomodified + setlocal nomodifiable endfunction " Function: Search file {{{1 @@ -183,7 +184,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 +323,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 +366,63 @@ 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