Replies: 1 comment 1 reply
-
Another option: add small interactive function that reports the result of
I can't think of spot in Magit that does section-based updating of the header line, and my vote would be to avoid introducing that complication. Without changes to Magit, you should be able to get the behavior you're after by defining a magit-section-movement-hook function. Here's an example: (defun my/magit-header-add-hunk-filename (section)
(when header-line-format
(let ((orig (get-text-property 0 'my/magit-hlf header-line-format)))
(cond
((magit-hunk-section-p section)
(let* ((base (or orig header-line-format))
(new (format "%s (hunk for %s)" base (magit-file-at-point))))
(put-text-property 0 1 'my/magit-hlf base new)
(setq header-line-format new)))
(orig
(setq header-line-format orig))))))
(add-hook 'magit-section-movement-hook #'my/magit-header-add-hunk-filename) |
Beta Was this translation helpful? Give feedback.
-
I often find myself looking at diffs that have many hunks per file. When I'm in the midst of such hunks, there's no indication on the screen of which file these hunks affect. It would be nice if the top line of the window showed, along with the text like
Changes in start...end
, the filename for the hunk that point is in.A workaround is to filter by filename.
Beta Was this translation helpful? Give feedback.
All reactions