Skip to content

Commit e9958ba

Browse files
committed
Consecutive result overlays can now seen
Previously, if multiple overlays were created one after another that are meant to last for one command, every second overlay wouldn't show up. This is because there's a hook in the 'post-command-hook that will delete all overlays, and it runs right after the second overlay is created. Instead, if we're creating an overlay as we speak (ie. we are in the function 'cider--make-result-overlay), we already know that the previous overlay has been deleted, and thus we can remove 'cider--remove-result-overlay from the 'post-command-hook.
1 parent b9e1cc2 commit e9958ba

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cider-overlays.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,13 @@ overlay."
232232
(display-string (format (propertize format 'face 'default) value))
233233
(o nil))
234234
(remove-overlays beg end 'category type)
235+
;; This hook was meant to delete the previous overlay. Since
236+
;; we already deleted it in the line above, remove the
237+
;; hook. Otheriwse, the new overlay that we're about to
238+
;; create would get deleted too.
239+
(when (member #'cider--remove-result-overlay post-command-hook)
240+
(remove-hook 'post-command-hook
241+
#'cider--remove-result-overlay 'local))
235242
(funcall (if cider-overlays-use-font-lock
236243
#'font-lock-prepend-text-property
237244
#'put-text-property)

0 commit comments

Comments
 (0)