mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-09 03:53:47 -05:00
Fix diff sometimes opening in preview window
If the previous window no longer exists when Gedit is called, the attempt to change windows with 'wincmd p' fails and 'wincmd w' should be used instead.
This commit is contained in:
@@ -1336,8 +1336,10 @@ function! s:Edit(cmd,bang,...) abort
|
|||||||
if winnr('$') == 1
|
if winnr('$') == 1
|
||||||
let tabs = (&go =~# 'e' || !has('gui_running')) && &stal && (tabpagenr('$') >= &stal)
|
let tabs = (&go =~# 'e' || !has('gui_running')) && &stal && (tabpagenr('$') >= &stal)
|
||||||
execute 'rightbelow' (&lines - &previewheight - &cmdheight - tabs - 1 - !!&laststatus).'new'
|
execute 'rightbelow' (&lines - &previewheight - &cmdheight - tabs - 1 - !!&laststatus).'new'
|
||||||
else
|
elseif winnr('#')
|
||||||
wincmd p
|
wincmd p
|
||||||
|
else
|
||||||
|
wincmd w
|
||||||
endif
|
endif
|
||||||
if &diff
|
if &diff
|
||||||
let mywinnr = winnr()
|
let mywinnr = winnr()
|
||||||
|
|||||||
Reference in New Issue
Block a user