You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the blame view of a renamed file, the %(file) contains the name of the file at each row's creation.
For example, running :echo %(file) on the two lines below (from src/refs.c) results in the echoing of column number two in the blame view.
395611e src/refs.c Thomas Koutcher 2022-05-09
5fd811f src/branch.c Jonas Fonseca 2014-02-25
I have not found a use case for the old filename, and my custom commands are not working on these lines, since they try to operate on a file that does not exist anymore.
I think it would be logical to set %(file) to the current filename, and maybe use %(file_old) to refer to the name of the file at the time of the commit.
Nice find. %(file_old) was only implemented for the diff view, we should fix it for the blame view too. I think changing %(file) be the new filename is unlikely to break anyone.
I think the code in src/blame.c uses %(file) (look for string_ncopy(view->env->file,) because at that time there was no %(file_old).
In the blame view of a renamed file, the
%(file)
contains the name of the file at each row's creation.For example, running
:echo %(file)
on the two lines below (from src/refs.c) results in the echoing of column number two in the blame view.I have not found a use case for the old filename, and my custom commands are not working on these lines, since they try to operate on a file that does not exist anymore.
I think it would be logical to set
%(file)
to the current filename, and maybe use%(file_old)
to refer to the name of the file at the time of the commit.Is this a bug or a feature? 😄
I have made a workaround for my use case.
The text was updated successfully, but these errors were encountered: