Variable: magit-diff-visit-previous-blob

magit-diff-visit-previous-blob is a customizable variable defined in magit-diff.el.

Value

t

Documentation

Whether magit-diff-visit-file may visit the previous blob.

When this is t (the default) and point is on a removed line, then magit-diff-visit-file visits the blob from the old/left commit, which still has that line, instead of going to the new/right blob, which removes that line.

Setting this to nil, causes magit-diff-visit-file to always go to the new/right blob, even when point is on a removed line. This is very strongly discouraged. Instead place the cursor anywhere else within the hunk but on a removed line, if you want to visit the new side. That way you don't lose the ability to visit the old side.

This variable was added, or its default value changed, in magit version 2.9.0.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-diff.el
(defcustom magit-diff-visit-previous-blob t
  "Whether `magit-diff-visit-file' may visit the previous blob.

When this is t (the default) and point is on a removed line, then
`magit-diff-visit-file' visits the blob from the old/left commit,
which still has that line, instead of going to the new/right blob,
which removes that line.

Setting this to nil, causes `magit-diff-visit-file' to always go to
the new/right blob, even when point is on a removed line.  This is
very strongly discouraged.  Instead place the cursor anywhere else
within the hunk but on a removed line, if you want to visit the new
side.  That way you don't lose the ability to visit the old side."
  :package-version '(magit . "2.9.0")
  :group 'magit-diff
  :type 'boolean)