mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 06:43:51 -05:00
Avoid spurious window resizing in :Gdiffsplit
Closes https://github.com/tpope/vim-fugitive/issues/1787
This commit is contained in:
@@ -5474,6 +5474,10 @@ function! fugitive#Diffsplit(autodir, keepfocus, mods, arg, args) abort
|
||||
exe pre
|
||||
let mods = (a:autodir ? s:diff_modifier(len(parents) + 1) : '') . s:Mods(mods, 'leftabove')
|
||||
let nr = bufnr('')
|
||||
if len(parents) > 1 && !&equalalways
|
||||
let equalalways = 0
|
||||
set equalalways
|
||||
endif
|
||||
execute mods 'split' s:fnameescape(fugitive#Find(parents[0]))
|
||||
call s:Map('n', 'dp', ':diffput '.nr.'<Bar>diffupdate<CR>', '<silent>')
|
||||
let nr2 = bufnr('')
|
||||
@@ -5490,9 +5494,6 @@ function! fugitive#Diffsplit(autodir, keepfocus, mods, arg, args) abort
|
||||
call s:Map('n', 'd' . (i + 2) . 'o', ':diffget '.nrx.'<Bar>diffupdate<CR>', '<silent>')
|
||||
endfor
|
||||
call s:diffthis()
|
||||
if len(parents) > 1
|
||||
wincmd =
|
||||
endif
|
||||
return post
|
||||
elseif len(args)
|
||||
let arg = join(args, ' ')
|
||||
@@ -5556,6 +5557,9 @@ function! fugitive#Diffsplit(autodir, keepfocus, mods, arg, args) abort
|
||||
catch /^fugitive:/
|
||||
return 'echoerr ' . string(v:exception)
|
||||
finally
|
||||
if exists('l:equalalways')
|
||||
let &l:equalalways = equalalways
|
||||
endif
|
||||
if exists('diffopt')
|
||||
let &diffopt = diffopt
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user