emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/beardbolt 3195997ccd 275/323: * beardbolt.el (bb--synch


From: ELPA Syncer
Subject: [elpa] externals/beardbolt 3195997ccd 275/323: * beardbolt.el (bb--synch-relation-overlays): Rework and bugfix.
Date: Thu, 9 Mar 2023 10:58:38 -0500 (EST)

branch: externals/beardbolt
commit 3195997ccdd1771e6f70bbe77e07ba82ed850f02
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    * beardbolt.el (bb--synch-relation-overlays): Rework and bugfix.
---
 beardbolt.el | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/beardbolt.el b/beardbolt.el
index a04b3d42ac..40fd89bfa2 100644
--- a/beardbolt.el
+++ b/beardbolt.el
@@ -760,19 +760,20 @@ Interactively, determine LANG from `major-mode'."
   "Update overlays to visually match selected source and asm lines.
 Runs in output buffer.  Sets `bb--relation-overlays'."
   (bb--delete-relation-overlays)
-  (let ((positions (plist-get (gethash source-line bb--line-mappings)
-                              :positions)))
-    (when positions
-      (bb--when-live-buffer bb--source-buffer
-        (save-excursion
-          (push
-           (progn
-             (goto-char (point-min))
-             (bb--make-relation-overlay
-              (line-beginning-position source-line)
-              (line-end-position source-line)))
-           bb--relation-overlays))
-        (bb--recenter-maybe (overlay-start (car bb--relation-overlays))))
+  (let* ((positions (plist-get (gethash source-line bb--line-mappings)
+                               :positions))
+         (src-overlay
+          (and positions
+               (bb--when-live-buffer bb--source-buffer
+                 (save-excursion
+                   (goto-char (point-min))
+                   (forward-line (1- source-line))
+                   (bb--recenter-maybe (point))
+                   (bb--make-relation-overlay
+                    (line-beginning-position)
+                    (line-end-position)))))))
+    (when src-overlay
+      (push src-overlay bb--relation-overlays)
       (cl-loop for (start . end) in positions
                do (push (bb--make-relation-overlay start end) 
bb--relation-overlays)
                finally (bb--recenter-maybe (caar positions))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]