This commit is contained in:
Miles Whittaker 2014-08-20 01:40:15 +00:00
commit 911f059f4b

View File

@ -458,11 +458,16 @@ function! s:lastline(msg)
return get(lines, -1, '') return get(lines, -1, '')
endfunction endfunction
function! s:new_window()
let window_cmd = get(g:, 'plug_window', 'vertical topleft new')
execute window_cmd
endfunction
function! s:prepare() function! s:prepare()
if bufexists(s:plug_buf) if bufexists(s:plug_buf)
let winnr = bufwinnr(s:plug_buf) let winnr = bufwinnr(s:plug_buf)
if winnr < 0 if winnr < 0
vertical topleft new call s:new_window()
execute 'buffer ' . s:plug_buf execute 'buffer ' . s:plug_buf
else else
execute winnr . 'wincmd w' execute winnr . 'wincmd w'
@ -470,7 +475,7 @@ function! s:prepare()
setlocal modifiable setlocal modifiable
silent %d _ silent %d _
else else
vertical topleft new call s:new_window()
nnoremap <silent> <buffer> q :if b:plug_preview==1<bar>pc<bar>endif<bar>q<cr> nnoremap <silent> <buffer> q :if b:plug_preview==1<bar>pc<bar>endif<bar>q<cr>
nnoremap <silent> <buffer> R :silent! call <SID>retry()<cr> nnoremap <silent> <buffer> R :silent! call <SID>retry()<cr>
nnoremap <silent> <buffer> D :PlugDiff<cr> nnoremap <silent> <buffer> D :PlugDiff<cr>