From cb613ca05d3d195d52cfb5ce32f44c1d9e196214 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 16 Aug 2019 18:02:28 +0200 Subject: [PATCH] Fix :Gdiffsplit with diffopt+=vertical Only remove "vertical" from `&diffopt` after calling `s:diff_modifier()`. Regressed in c972b2a. References https://github.com/tpope/vim-fugitive/pull/805#issuecomment-522057790. --- autoload/fugitive.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index e2182d1..1a2a1f3 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -4416,10 +4416,6 @@ function! s:Diff(autodir, keepfocus, mods, ...) abort 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('') @@ -4482,6 +4478,10 @@ function! s:Diff(autodir, keepfocus, mods, ...) abort let mods = s:Mods(mods, 'leftabove') endif let mods = (a:autodir ? s:diff_modifier(2) : '') . mods + if &diffopt =~# 'vertical' + let diffopt = &diffopt + set diffopt-=vertical + endif execute mods 'diffsplit' s:fnameescape(spec) let &l:readonly = &l:readonly redraw