Consecutive result overlays can now seen #3215
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a minor bug that has just bothered me for years, and I've finally decided to fix it.
When I run cider-eval-last-sexp twice, the second overlay never shows up. This is because we're letting the hook that's supposed to kill overlay #1 also kill overlay #2. When creating a second overlay right after the first one, we already remove overlay #1 in #'cider--make-result-overlay, and thus we can safely remove #'cider--remove-result-overlay from the post-command-hook.
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.
Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
eldev test
)eldev lint
) which is based onelisp-lint
and includescheckdoc
, check-declare, packaging metadata, indentation, and trailing whitespace checks.Thanks!
If you're just starting out to hack on CIDER you might find this section of its
manual extremely useful.