From 8b30ab814572c9b542344efcb98a3074ea46c6e1 Mon Sep 17 00:00:00 2001 From: Kenny Date: Wed, 26 Nov 2014 03:32:21 -0500 Subject: [PATCH] Adding tlWindowPosition 2 and 3 for v-split 2 = Open to the left 3 = Open to the right --- plugin/tasklist.vim | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/plugin/tasklist.vim b/plugin/tasklist.vim index 25e9e73..7620878 100644 --- a/plugin/tasklist.vim +++ b/plugin/tasklist.vim @@ -78,6 +78,8 @@ " in your vimrc file, options are as follows: " 0 = Open on top " 1 = Open on the bottom +" 2 = Open on the left +" 3 = Open on the right " " g:tlTokenList " This is the list of tokens to search for default is @@ -134,9 +136,17 @@ endif function! s:OpenWindow(buffnr, lineno) " Open results window and place items there. if g:tlWindowPosition == 0 - execute 'sp -TaskList_'.a:buffnr.'-' + execute 'sp -TaskList_'.a:buffnr.'-' else - execute 'botright sp -TaskList_'.a:buffnr.'-' + if g:tlWindowPosition == 1 + execute 'botright sp -TaskList_'.a:buffnr.'-' + else + if g:tlWindowPosition == 2 + execute 'vsp -TaskList_'.a:buffnr.'-' + else + execute 'botright vsp -TaskList_'.a:buffnr.'-' + endif + endif endif let b:original_buffnr = a:buffnr @@ -151,9 +161,13 @@ function! s:OpenWindow(buffnr, lineno) normal! zR " Resize line if too big. - let l:hits = line("$") - if l:hits < winheight(0) - sil! exe "resize ".l:hits + if g:tlWindowPosition < 2 + let l:hits = line("$") + if l:hits < winheight(0) + sil! exe "resize ".l:hits + endif + else + sil! exe "vertical resize 35" endif " Clean up. @@ -183,7 +197,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