From 9211b11cd251df68c2b4198fb853318065d7544a Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 9 Jan 2019 15:00:36 -0500 Subject: [PATCH] Use native edit commands in :Gstatus This lets the :topleft modification kick in on older versions of Vim. --- autoload/fugitive.vim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index ee9c793..6b63e5e 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -1899,7 +1899,8 @@ function! s:Status(bang, count, mods) abort let mods = 'topleft ' . mods endif let file = fugitive#Find(':') - let arg = ' +setl\ foldmethod=syntax\ foldlevel=1\|let\ w:fugitive_status=FugitiveGitDir() :' + let arg = ' +setl\ foldmethod=syntax\ foldlevel=1\|let\ w:fugitive_status=FugitiveGitDir() ' . + \ s:fnameescape(file) for winnr in range(1, winnr('$')) if s:cpath(file, fnamemodify(bufname(winbufnr(winnr)), ':p')) exe winnr . 'wincmd w' @@ -1908,11 +1909,11 @@ function! s:Status(bang, count, mods) abort endif endfor if a:count ==# 0 - return mods . 'Gedit' . (a:bang ? '!' : '') . arg + return mods . 'edit' . (a:bang ? '!' : '') . arg elseif a:bang - return mods . 'Gpedit' . arg . '|wincmd P' + return mods . 'pedit' . arg . '|wincmd P' else - return mods . (a:count > 0 ? a:count : '') . 'Gsplit' . arg + return mods . (a:count > 0 ? a:count : '') . 'split' . arg endif catch /^fugitive:/ return 'echoerr v:errmsg'