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:
parent
8cf3d94a3a
commit
dba8a0705d
@ -1336,8 +1336,10 @@ function! s:Edit(cmd,bang,...) abort
|
||||
if winnr('$') == 1
|
||||
let tabs = (&go =~# 'e' || !has('gui_running')) && &stal && (tabpagenr('$') >= &stal)
|
||||
execute 'rightbelow' (&lines - &previewheight - &cmdheight - tabs - 1 - !!&laststatus).'new'
|
||||
else
|
||||
elseif winnr('#')
|
||||
wincmd p
|
||||
else
|
||||
wincmd w
|
||||
endif
|
||||
if &diff
|
||||
let mywinnr = winnr()
|
||||
|
Loading…
Reference in New Issue
Block a user