Function: magit-diff-visit-worktree-file
magit-diff-visit-worktree-file is an interactive and byte-compiled
function defined in magit-diff.el.
Signature
(magit-diff-visit-worktree-file &optional OTHER-WINDOW)
Documentation
From a diff visit the worktree version of the file at point.
Display the buffer in the selected window. With a prefix argument, OTHER-WINDOW, display the buffer in another window instead.
Visit the worktree version of the appropriate file. The location of point inside the diff determines which file is being visited.
Unlike magit-diff-visit-file always visits the "real" file in
the working tree, i.e., the "current version" of the file.
In the file-visiting buffer also go to the line that corresponds to the line that point is on in the diff. Lines that were added or removed in the working tree, the index and other commits in between are automatically accounted for.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-diff.el
;;;;; Worktree Variants
(defun magit-diff-visit-worktree-file (&optional other-window)
"From a diff visit the worktree version of the file at point.
Display the buffer in the selected window. With a prefix argument,
OTHER-WINDOW, display the buffer in another window instead.
Visit the worktree version of the appropriate file. The location
of point inside the diff determines which file is being visited.
Unlike `magit-diff-visit-file' always visits the \"real\" file in
the working tree, i.e., the \"current version\" of the file.
In the file-visiting buffer also go to the line that corresponds
to the line that point is on in the diff. Lines that were added
or removed in the working tree, the index and other commits in
between are automatically accounted for."
(interactive "P")
(magit-diff-visit-file--internal t (and other-window t)))