Fix :Ghdiffsplit with diffopt=vertical
Closes https://github.com/tpope/vim-fugitive/issues/990
This commit is contained in:
parent
cf9ef7377f
commit
c972b2a065
@ -4414,6 +4414,11 @@ function! s:Diff(autodir, keepfocus, mods, ...) abort
|
||||
call map(parents, 's:Relative(v:val . ":")')
|
||||
endif
|
||||
endif
|
||||
try
|
||||
if &diffopt =~# 'vertical'
|
||||
let diffopt = &diffopt
|
||||
set diffopt-=vertical
|
||||
endif
|
||||
if exists('parents') && len(parents) > 1
|
||||
let mods = (a:autodir ? s:diff_modifier(len(parents) + 1) : '') . s:Mods(mods, 'leftabove')
|
||||
let nr = bufnr('')
|
||||
@ -4464,7 +4469,6 @@ function! s:Diff(autodir, keepfocus, mods, ...) abort
|
||||
else
|
||||
let file = s:Relative(':0:')
|
||||
endif
|
||||
try
|
||||
let spec = s:Generate(file)
|
||||
let restore = s:diff_restore()
|
||||
if exists('+cursorbind')
|
||||
@ -4491,6 +4495,10 @@ function! s:Diff(autodir, keepfocus, mods, ...) abort
|
||||
return post
|
||||
catch /^fugitive:/
|
||||
return 'echoerr ' . string(v:exception)
|
||||
finally
|
||||
if exists('diffopt')
|
||||
let &diffopt = diffopt
|
||||
endif
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user