mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-11 21:03:53 -05:00
Provide :Gdiffsplit ++novertical
Maybe one day we can kill :Ghdiffsplit.
This commit is contained in:
@@ -6146,6 +6146,15 @@ function! fugitive#Diffsplit(autodir, keepfocus, mods, arg, args) abort
|
|||||||
exe s:VersionCheck()
|
exe s:VersionCheck()
|
||||||
let args = s:ArgSplit(a:arg)
|
let args = s:ArgSplit(a:arg)
|
||||||
let post = ''
|
let post = ''
|
||||||
|
let autodir = a:autodir
|
||||||
|
while get(args, 0, '') =~# '^++'
|
||||||
|
if args[0] =~? '^++novertical$'
|
||||||
|
let autodir = 0
|
||||||
|
else
|
||||||
|
return 'echoerr ' . string('fugitive: unknown option ' . args[0])
|
||||||
|
endif
|
||||||
|
call remove(args, 0)
|
||||||
|
endwhile
|
||||||
if get(args, 0) =~# '^+'
|
if get(args, 0) =~# '^+'
|
||||||
let post = remove(args, 0)[1:-1]
|
let post = remove(args, 0)[1:-1]
|
||||||
endif
|
endif
|
||||||
@@ -6177,7 +6186,7 @@ function! fugitive#Diffsplit(autodir, keepfocus, mods, arg, args) abort
|
|||||||
try
|
try
|
||||||
if exists('parents') && len(parents) > 1
|
if exists('parents') && len(parents) > 1
|
||||||
exe pre
|
exe pre
|
||||||
let mods = (a:autodir ? s:diff_modifier(len(parents) + 1) : '') . s:Mods(mods, 'leftabove')
|
let mods = (autodir ? s:diff_modifier(len(parents) + 1) : '') . s:Mods(mods, 'leftabove')
|
||||||
let nr = bufnr('')
|
let nr = bufnr('')
|
||||||
if len(parents) > 1 && !&equalalways
|
if len(parents) > 1 && !&equalalways
|
||||||
let equalalways = 0
|
let equalalways = 0
|
||||||
@@ -6228,7 +6237,9 @@ function! fugitive#Diffsplit(autodir, keepfocus, mods, arg, args) abort
|
|||||||
let file = s:Relative()
|
let file = s:Relative()
|
||||||
elseif s:IsConflicted()
|
elseif s:IsConflicted()
|
||||||
let file = s:Relative(':1:')
|
let file = s:Relative(':1:')
|
||||||
let post = 'echohl WarningMsg|echo "Use :Gdiffsplit! for 3 way diff"|echohl NONE|' . post
|
if get(g:, 'fugitive_legacy_commands', 1)
|
||||||
|
let post = 'echohl WarningMsg|echo "Use :Gdiffsplit! for 3 way diff"|echohl NONE|' . post
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
exe s:DirCheck()
|
exe s:DirCheck()
|
||||||
let file = s:Relative(':0:')
|
let file = s:Relative(':0:')
|
||||||
@@ -6245,7 +6256,7 @@ function! fugitive#Diffsplit(autodir, keepfocus, mods, arg, args) abort
|
|||||||
else
|
else
|
||||||
let mods = s:Mods(mods, 'leftabove')
|
let mods = s:Mods(mods, 'leftabove')
|
||||||
endif
|
endif
|
||||||
let mods = (a:autodir ? s:diff_modifier(2) : '') . mods
|
let mods = (autodir ? s:diff_modifier(2) : '') . mods
|
||||||
if &diffopt =~# 'vertical'
|
if &diffopt =~# 'vertical'
|
||||||
let diffopt = &diffopt
|
let diffopt = &diffopt
|
||||||
set diffopt-=vertical
|
set diffopt-=vertical
|
||||||
|
|||||||
Reference in New Issue
Block a user