mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-12-07 12:44:33 +08:00
Use <cfile> not <cword> for temp file "." map
Also, skip over that "+" that marks work-tree branches in :Git branch output.
This commit is contained in:
@@ -2949,7 +2949,11 @@ endfunction
|
|||||||
function! s:TempDotMap() abort
|
function! s:TempDotMap() abort
|
||||||
let cfile = s:cfile()
|
let cfile = s:cfile()
|
||||||
if empty(cfile)
|
if empty(cfile)
|
||||||
return expand('<cword>')
|
if getline('.') =~# '^[*+] \+\f' && col('.') < 2
|
||||||
|
return matchstr(getline('.'), '^. \+\zs\f\+')
|
||||||
|
else
|
||||||
|
return expand('<cfile>')
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
let name = fugitive#Find(cfile[0])
|
let name = fugitive#Find(cfile[0])
|
||||||
let [dir, commit, file] = s:DirCommitFile(name)
|
let [dir, commit, file] = s:DirCommitFile(name)
|
||||||
|
|||||||
Reference in New Issue
Block a user