Function: majutsu--refresh-buffer-set-positions

majutsu--refresh-buffer-set-positions is a natively compiled function defined in majutsu-mode.el.

Signature

(majutsu--refresh-buffer-set-positions POSITIONS)

Documentation

Restore POSITIONS returned by majutsu--refresh-buffer-get-positions.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-mode.el
(defun majutsu--refresh-buffer-set-positions (positions)
  "Restore POSITIONS returned by `majutsu--refresh-buffer-get-positions'."
  (pcase-dolist
      (`(,window ,section ,line ,char ,ws-section ,ws-line ,window-start)
       positions)
    (if window
        (with-selected-window window
          (magit-section-goto-successor section line char)
          (unless (derived-mode-p 'majutsu-log-mode)
            (cond
             ((not window-start))
             ((> window-start (point)))
             ((and ws-section
                   (magit-section-equal ws-section
                                        (magit-section-at window-start)))
              (set-window-start window window-start t))
             (t
              (let ((pos (save-excursion
                           (and ws-section
                                (integerp ws-line)
                                (magit-section-goto-successor--same
                                 ws-section ws-line 0)
                                (point)))))
                (when pos
                  (set-window-start window pos t)))))))
      (let ((magit-section-movement-hook nil))
        (magit-section-goto-successor section line char)))))