Skip to content

Commit

Permalink
Fix jumped-to overlays not being pulse-highlighted
Browse files Browse the repository at this point in the history
* compiler-explorer.el (compiler-explorer-jump): Call the pulse
function with `run-with-timer', as another function might immediately
change the overlay's face when this function exits.
  • Loading branch information
mkcms committed Oct 14, 2024
1 parent ae46bae commit 6603a88
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions compiler-explorer.el
Original file line number Diff line number Diff line change
Expand Up @@ -1396,8 +1396,7 @@ the same source line."
(= index-of-this-ov (1- (length group)))))
;; Jump to the other buffer, e.g. source from ASM
(overlay-get ov 'compiler-explorer--target)
(nth requested-within-group group)))
(buf (overlay-buffer target-ov)))
(nth requested-within-group group))))
(setq group (overlay-get target-ov 'compiler-explorer--overlay-group))

(when (null which)
Expand All @@ -1407,10 +1406,14 @@ the same source line."
(abs (- (overlay-start ov) (point)))))
#'< group))))

(pop-to-buffer buf)
(with-current-buffer buf
(pulse-momentary-highlight-overlay target-ov)
(goto-char (overlay-start target-ov)))
(pop-to-buffer (overlay-buffer target-ov))
(goto-char (overlay-start target-ov))

;; Pulse it later, as `cursor-sensor-functions' might trigger right
;; after we quit this function (due to point movement), and they might
;; change the overlay's face.
(run-with-timer 0.0 nil #'pulse-momentary-highlight-overlay target-ov)

(message "%s block %d/%d"
(if (eq (current-buffer)
(get-buffer compiler-explorer--buffer))
Expand Down

0 comments on commit 6603a88

Please sign in to comment.