Closed Miciah closed 5 years ago
I noticed that it does not include the line numbers when linking from a blob.
Thanks for noticing this, I had missed it. I'll look into it.
I believe I fixed the missing line numbers. (I'm curious why the when
form that I modified is needed at all.)
Great, thanks again!
(I'm curious why the when form that I modified is needed at all.)
Because one can link to a file in a dired buffer or in magit buffers and in these cases we don't have an actual file and therefore cannot/should not get the region.
Use the correct branch or commit when the current buffer is visiting a blob using Magit.
git-link.el
(git-link--commit
): Use themagit-buffer-revision
variable if the buffer is using Magit-Blob mode. (git-link--branch
): Look up the branch usingmagit-buffer-revision
and themagit-rev-branch
function if the buffer is using Magit-Blob mode. (git-link--relative-filename
): Use themagit-buffer-file-name
variable the buffer is using Magit-Blob mode. (git-link--using-magit-blob-mode
): New function. (git-link
): Set the region and ignore the branch that is checked out into the working tree when using Magit-Blob mode.