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.
This commit is contained in:
Tim Pope
2019-09-03 23:45:54 -04:00
parent 2eb6aac0c4
commit 99ad1a89fa
2 changed files with 4 additions and 4 deletions

View File

@@ -5847,9 +5847,6 @@ function! fugitive#Init() abort
call s:Map('c', '<C-R><C-G>', '<SID>fnameescape(fugitive#Object(@%))', '<expr>') call s:Map('c', '<C-R><C-G>', '<SID>fnameescape(fugitive#Object(@%))', '<expr>')
call s:Map('n', 'y<C-G>', ':<C-U>call setreg(v:register, fugitive#Object(@%))<CR>', '<silent>') call s:Map('n', 'y<C-G>', ':<C-U>call setreg(v:register, fugitive#Object(@%))<CR>', '<silent>')
endif endif
if expand('%:p') =~# ':[\/][\/]'
let &l:path = s:sub(&path, '^\.%(,|$)', '')
endif
let dir = s:Dir() let dir = s:Dir()
if stridx(&tags, escape(dir, ', ')) == -1 && &tags !~# '\.git' && !exists('s:tags_warning') if stridx(&tags, escape(dir, ', ')) == -1 && &tags !~# '\.git' && !exists('s:tags_warning')
let actualdir = fugitive#Find('.git/', dir) let actualdir = fugitive#Find('.git/', dir)

View File

@@ -341,7 +341,10 @@ augroup fugitive
\ silent doautocmd BufNewFile | \ silent doautocmd BufNewFile |
\ endif \ 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 BufWriteCmd fugitive://*//[0-3]/* exe fugitive#BufWriteCmd()
autocmd FileReadCmd fugitive://*//* exe fugitive#FileReadCmd() autocmd FileReadCmd fugitive://*//* exe fugitive#FileReadCmd()
autocmd FileWriteCmd fugitive://*//[0-3]/* exe fugitive#FileWriteCmd() autocmd FileWriteCmd fugitive://*//[0-3]/* exe fugitive#FileWriteCmd()