Function: majutsu-diff-refresh-buffer
majutsu-diff-refresh-buffer is an interactive and natively compiled
function defined in majutsu-diff.el.
Signature
(majutsu-diff-refresh-buffer)
Documentation
Refresh the current diff buffer.
Key Bindings
This command is not in any keymaps.
Source Code
;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-diff.el
(defun majutsu-diff-refresh-buffer ()
"Refresh the current diff buffer."
(interactive)
(when majutsu-buffer-diff-args
;; Metadata is refreshed once per buffer refresh, then shared by the
;; header and message inserters through the argument-keyed cache.
(setq majutsu-diff--revision-metadata-cache nil)
(let* ((backend (majutsu-diff--sync-backend))
(majutsu-jj-global-arguments
(cons (if (eq backend 'color-words) "--color=debug" "--color=never")
(seq-remove (lambda (arg) (string-prefix-p "--color" arg))
majutsu-jj-global-arguments)))
;; Diff buffers are used as patch source by interactive commands.
;; For the regular git backend we force `--color=never', so applying
;; `ansi-color' here is unnecessary and corrupts file contents that
;; contain literal ANSI escape sequences. Color-words handles its
;; own ANSI/debug output in its washer.
(majutsu-process-apply-ansi-colors nil))
;; Refresh JIT Lock so it renders the faces attached by the washer.
(font-lock-mode 1)
(unless (eq backend 'color-words)
(majutsu-diff--set-left-margin 0))
(magit-insert-section (diffbuf)
(magit-run-section-hook 'majutsu-diff-sections-hook))
(when (eq majutsu-diff-fontify-hunk 'all)
(majutsu-diff--update-hunk-syntax))
(when (eq majutsu-diff-refine-hunk 'all)
(majutsu-diff--update-hunk-refinement)))))