Support all <cword> style expansions

The previous implementation for <cfile> didn't handle <cfile>:h
correctly.  May as well support the rest of the gang while fixing this.
Note that unlike for % and #, these can return a commit in addition to a
file name.  Use a ":." expansion, as in "<cfile>:.", to get the
corresponding work tree file.
This commit is contained in:
Tim Pope
2021-04-07 00:11:33 -04:00
parent d4d2b9c6b2
commit cd8bd39567
2 changed files with 24 additions and 7 deletions

View File

@@ -588,8 +588,9 @@ Makefile The file named Makefile in the work tree
!:Makefile The file named Makefile in the commit owning the current file
!3^2 The second parent of the commit owning buffer #3
.git/config The repo config file
: The |fugitive-summary| buffer.
: The |fugitive-summary| buffer
- A temp file containing the last |:Git| invocation's output
<cfile> The file or commit under the cursor
STATUSLINE *fugitive-statusline*