From 99ad1a89fa8d4b9e61ccdc81eb60b7287dda4a2c Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 3 Sep 2019 23:45:54 -0400 Subject: [PATCH] Relocate 'path' adjustment I'm not sure where we should do this (if at all), but after loading the appropriate buffer (and thus applying the file type) is a better place than during general activation. --- autoload/fugitive.vim | 3 --- plugin/fugitive.vim | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 65cf84c..ac21b82 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -5847,9 +5847,6 @@ function! fugitive#Init() abort call s:Map('c', '', 'fnameescape(fugitive#Object(@%))', '') call s:Map('n', 'y', ':call setreg(v:register, fugitive#Object(@%))', '') endif - if expand('%:p') =~# ':[\/][\/]' - let &l:path = s:sub(&path, '^\.%(,|$)', '') - endif let dir = s:Dir() if stridx(&tags, escape(dir, ', ')) == -1 && &tags !~# '\.git' && !exists('s:tags_warning') let actualdir = fugitive#Find('.git/', dir) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 71d0e2b..2891e64 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -341,7 +341,10 @@ augroup fugitive \ silent doautocmd BufNewFile | \ endif - autocmd BufReadCmd fugitive://*//* exe fugitive#BufReadCmd() + autocmd BufReadCmd fugitive://*//* exe fugitive#BufReadCmd() | + \ if &path =~# '^\.\%(,\|$\)' | + \ let &l:path = substitute(&path, '^\.,\=', '', '') | + \ endif autocmd BufWriteCmd fugitive://*//[0-3]/* exe fugitive#BufWriteCmd() autocmd FileReadCmd fugitive://*//* exe fugitive#FileReadCmd() autocmd FileWriteCmd fugitive://*//[0-3]/* exe fugitive#FileWriteCmd()