Function: majutsu--refresh-buffer-get-positions

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

Signature

(majutsu--refresh-buffer-get-positions)

Documentation

Return positions for all windows displaying the current buffer.

The returned value is a list of entries of the form:
  (WINDOW SECTION LINE CHAR WS-SECTION WS-LINE WINDOW-START).

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-mode.el
(defun majutsu--refresh-buffer-get-positions ()
  "Return positions for all windows displaying the current buffer.

The returned value is a list of entries of the form:
  (WINDOW SECTION LINE CHAR WS-SECTION WS-LINE WINDOW-START)."
  (let* ((buffer (current-buffer))
         (windows (nreverse (get-buffer-window-list buffer nil t)))
         positions)
    (dolist (window windows)
      (with-selected-window window
        (with-current-buffer buffer
          (when-let* ((section (magit-section-at)))
            (pcase-let* ((`(,line ,char)
                          (magit-section-get-relative-position section))
                         (ws (magit-section-at (window-start)))
                         (ws-line (and ws
                                       (car (magit-section-get-relative-position ws))))
                         (ws-start (and ws (window-start))))
              (push (list window section line char ws ws-line ws-start)
                    positions))))))
    (or (nreverse positions)
        (when-let* ((section (magit-section-at)))
          (pcase-let ((`(,line ,char)
                       (magit-section-get-relative-position section)))
            (list (list nil section line char nil nil nil)))))))