Function: magit-diff-toggle-file-filter
magit-diff-toggle-file-filter is an interactive and natively compiled
function defined in magit-diff.el.
Signature
(magit-diff-toggle-file-filter)
Documentation
Toggle the file restriction of the current buffer's diffs.
If the current buffer's mode is derived from magit-log-mode,
toggle the file restriction in the repository's revision buffer
instead.
Key Bindings
This command is not in any keymaps.
Source Code
;; Defined in /nix/store/irvbdy0zra0dn8fpd008f32x5ix6qm5v-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-20261005.508/magit-diff.el
(defun magit-diff-toggle-file-filter ()
"Toggle the file restriction of the current buffer's diffs.
If the current buffer's mode is derived from `magit-log-mode',
toggle the file restriction in the repository's revision buffer
instead."
(interactive)
(cl-flet ((toggle ()
(if (or magit-buffer-diff-files
magit-buffer-diff-files-suspended)
(cl-rotatef magit-buffer-diff-files
magit-buffer-diff-files-suspended)
(setq magit-buffer-diff-files
(transient-infix-read 'magit:--)))
(magit-refresh)))
(cond
((derived-mode-p 'magit-log-mode
'magit-cherry-mode
'magit-reflog-mode)
(if-let ((buffer (magit-get-mode-buffer 'magit-revision-mode)))
(with-current-buffer buffer (toggle))
(message "No revision buffer")))
((local-variable-p 'magit-buffer-diff-files)
(toggle))
((user-error "Cannot toggle file filter in this buffer")))))