mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 23:03:51 -05:00
Respect 'splitright' instead of 'splitbelow' for :vertical
Resolves: https://github.com/tpope/vim-fugitive/issues/1839
This commit is contained in:
@@ -125,7 +125,15 @@ function! s:Mods(mods, ...) abort
|
|||||||
let mods = substitute(a:mods, '\C<mods>', '', '')
|
let mods = substitute(a:mods, '\C<mods>', '', '')
|
||||||
let mods = mods =~# '\S$' ? mods . ' ' : mods
|
let mods = mods =~# '\S$' ? mods . ' ' : mods
|
||||||
if a:0 && mods !~# '\<\%(aboveleft\|belowright\|leftabove\|rightbelow\|topleft\|botright\|tab\)\>'
|
if a:0 && mods !~# '\<\%(aboveleft\|belowright\|leftabove\|rightbelow\|topleft\|botright\|tab\)\>'
|
||||||
let mods = a:1 . ' ' . mods
|
if a:1 ==# 'Edge'
|
||||||
|
if mods =~# '\<vertical\>' ? &splitright : &splitbelow
|
||||||
|
let mods = 'botright ' . mods
|
||||||
|
else
|
||||||
|
let mods = 'topleft ' . mods
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let mods = a:1 . ' ' . mods
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
return substitute(mods, '\s\+', ' ', 'g')
|
return substitute(mods, '\s\+', ' ', 'g')
|
||||||
endfunction
|
endfunction
|
||||||
@@ -3596,7 +3604,7 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
|
|||||||
if a:bang && pager isnot# 2
|
if a:bang && pager isnot# 2
|
||||||
let pager = 1
|
let pager = 1
|
||||||
let stream = exists('*setbufline')
|
let stream = exists('*setbufline')
|
||||||
let do_edit = substitute(s:Mods(a:mods, &splitbelow ? 'botright' : 'topleft'), '\<tab\>', '-tab', 'g') . 'pedit!'
|
let do_edit = substitute(s:Mods(a:mods, 'Edge'), '\<tab\>', '-tab', 'g') . 'pedit!'
|
||||||
elseif pager
|
elseif pager
|
||||||
let allow_pty = 0
|
let allow_pty = 0
|
||||||
if pager is# 2 && a:bang && a:line2 >= 0
|
if pager is# 2 && a:bang && a:line2 >= 0
|
||||||
@@ -3872,7 +3880,7 @@ function! s:StatusCommand(line1, line2, range, count, bang, mods, reg, arg, args
|
|||||||
let dir = a:0 ? s:Dir(a:1) : s:Dir()
|
let dir = a:0 ? s:Dir(a:1) : s:Dir()
|
||||||
exe s:DirCheck(dir)
|
exe s:DirCheck(dir)
|
||||||
try
|
try
|
||||||
let mods = s:Mods(a:mods, &splitbelow ? 'botright' : 'topleft')
|
let mods = s:Mods(a:mods, 'Edge')
|
||||||
let file = fugitive#Find(':', dir)
|
let file = fugitive#Find(':', dir)
|
||||||
let arg = ' +setl\ foldmarker=<<<<<<<<,>>>>>>>>\|let\ w:fugitive_status=FugitiveGitDir() ' .
|
let arg = ' +setl\ foldmarker=<<<<<<<<,>>>>>>>>\|let\ w:fugitive_status=FugitiveGitDir() ' .
|
||||||
\ s:fnameescape(file)
|
\ s:fnameescape(file)
|
||||||
|
|||||||
Reference in New Issue
Block a user