Use includeexpr on default <cfile>
Closes https://github.com/tpope/vim-fugitive/issues/744
This commit is contained in:
parent
fd36aa9c61
commit
9835920a3c
@ -2982,7 +2982,11 @@ function! fugitive#cfile() abort
|
|||||||
let pre = ''
|
let pre = ''
|
||||||
let results = s:cfile()
|
let results = s:cfile()
|
||||||
if empty(results)
|
if empty(results)
|
||||||
return expand('<cfile>')
|
let cfile = expand('<cfile>')
|
||||||
|
if &includeexpr =~# '\<v:fname\>'
|
||||||
|
sandbox let cfile = eval(substitute(&includeexpr, '\C\<v:fname\>', '\=string(cfile)', 'g'))
|
||||||
|
endif
|
||||||
|
return cfile
|
||||||
elseif len(results) > 1
|
elseif len(results) > 1
|
||||||
let pre = '+' . join(map(results[1:-1], 'escape(v:val, " ")'), '\|') . ' '
|
let pre = '+' . join(map(results[1:-1], 'escape(v:val, " ")'), '\|') . ' '
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user