Verified Commit 4193085d authored by Jay Kamat's avatar Jay Kamat 😠

Add :force t argument to rmsbolt-move-overlays

This forces movement to recenter the first line of the match.

I'm not fully exposing this because I don't want to hard-support it,
this is best-of-effort for now.
parent 62e68ea2
Pipeline #99294534 passed with stage
in 33 seconds
......@@ -1588,8 +1588,11 @@ Are you running two compilations at the same time?"))
(defun rmsbolt-move-overlays ()
"Function for moving overlays for rmsbolt."
(cl-defun rmsbolt-move-overlays (&key (force nil))
"Function for moving overlays for rmsbolt.
If FORCE, always scroll overlay, even when one is visible.
FORCE also scrolls to the first line, instead of the first line
of the last block."
(when rmsbolt-mode
(if-let ((should-run rmsbolt-use-overlays)
......@@ -1641,14 +1644,18 @@ Are you running two compilations at the same time?"))
(setq line-visible visible))
(push (rmsbolt--setup-overlay start-pt end-pt output-buffer)
(unless line-visible
(when (or (not line-visible) force)
;; Scroll buffer to first line
(when-let ((scroll-buffer (if src-buffer-selected
(line-scroll (if src-buffer-selected
(cl-first asm-lines))
(if force
;; If forcing, pick the min line instead
(if force
(car-safe (last asm-lines))
(cl-first asm-lines))))
(window (get-buffer-window scroll-buffer)))
(with-selected-window window
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment