mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 13:53:51 -05:00
Extend :Gdiffsplit zero argument positioning to ">" arguments
And change the jump to file map to use it, eliminating the behavior change there (at least for now). Resolves: https://github.com/tpope/vim-fugitive/issues/1821
This commit is contained in:
@@ -6158,7 +6158,7 @@ function! fugitive#Diffsplit(autodir, keepfocus, mods, arg, args) abort
|
|||||||
let pre = ''
|
let pre = ''
|
||||||
endif
|
endif
|
||||||
let back = exists('*win_getid') ? 'call win_gotoid(' . win_getid() . ')' : 'wincmd p'
|
let back = exists('*win_getid') ? 'call win_gotoid(' . win_getid() . ')' : 'wincmd p'
|
||||||
if (empty(args) || args[0] ==# ':') && a:keepfocus
|
if (empty(args) || args[0] =~# '^>\=:$') && a:keepfocus
|
||||||
exe s:DirCheck()
|
exe s:DirCheck()
|
||||||
if commit =~# '^1\=$' && s:IsConflicted()
|
if commit =~# '^1\=$' && s:IsConflicted()
|
||||||
let parents = [s:Relative(':2:'), s:Relative(':3:')]
|
let parents = [s:Relative(':2:'), s:Relative(':3:')]
|
||||||
@@ -6174,7 +6174,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 = (autodir ? s:DiffModifier(len(parents) + 1, empty(args)) : '') . s:Mods(mods, 'leftabove')
|
let mods = (autodir ? s:DiffModifier(len(parents) + 1, empty(args) || args[0] =~# '^>') : '') . 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
|
||||||
@@ -6219,7 +6219,7 @@ function! fugitive#Diffsplit(autodir, keepfocus, mods, arg, args) abort
|
|||||||
return 'echoerr ' . string(v:exception)
|
return 'echoerr ' . string(v:exception)
|
||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
if a:keepfocus
|
if a:keepfocus || arg =~# '^>'
|
||||||
let mods = s:Mods(a:mods, 'leftabove')
|
let mods = s:Mods(a:mods, 'leftabove')
|
||||||
else
|
else
|
||||||
let mods = s:Mods(a:mods)
|
let mods = s:Mods(a:mods)
|
||||||
@@ -6248,7 +6248,7 @@ function! fugitive#Diffsplit(autodir, keepfocus, mods, arg, args) abort
|
|||||||
exe pre
|
exe pre
|
||||||
let restore = s:diff_restore()
|
let restore = s:diff_restore()
|
||||||
let w:fugitive_diff_restore = restore
|
let w:fugitive_diff_restore = restore
|
||||||
let mods = (autodir ? s:DiffModifier(2, empty(args)) : '') . mods
|
let mods = (autodir ? s:DiffModifier(2, empty(args) || args[0] =~# '^>') : '') . mods
|
||||||
if &diffopt =~# 'vertical'
|
if &diffopt =~# 'vertical'
|
||||||
let diffopt = &diffopt
|
let diffopt = &diffopt
|
||||||
set diffopt-=vertical
|
set diffopt-=vertical
|
||||||
@@ -7596,7 +7596,7 @@ function! s:cfile() abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if exists('dref')
|
if exists('dref')
|
||||||
return [ref, dcmd . ' ' . s:fnameescape(dref)] + dcmds
|
return [ref, dcmd . ' >' . s:fnameescape(dref)] + dcmds
|
||||||
elseif ref != ""
|
elseif ref != ""
|
||||||
return [ref] + dcmds
|
return [ref] + dcmds
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user