Resync load-state indicators after namespace reloads - #3980
Merged
Conversation
The per-form eval fringe and the namespace load-state marker only ever got refreshed by the load-file handler (C-c C-k). `cider-ns-reload`, `-reload-all` and `cider-ns-refresh` went around it, so after a reload a buffer's markers stayed stale even though its namespace was current again. Extract the load handler's resync into `cider--mark-loaded` (re-mark the fringe across the buffer + run `cider-file-loaded-hook`) and call it from the reload paths for the namespaces actually reloaded - but only for buffers with no unsaved edits, since `:reload` loads from disk and an unsaved buffer is genuinely out of sync. `cider-ns-refresh` threads the reloaded-namespace list through a per-request cell, so concurrent refreshes across REPLs can't clobber each other. Since this routes through `cider-file-loaded-hook', `cider-auto-test-mode' now re-runs tests on reload too, consistent with `cider-load-buffer'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to #3973. The new load-state indicators (per-form eval fringe + the namespace mode-line/fringe marker) only ever got refreshed by the load-file handler, i.e.
cider-load-buffer(C-c C-k).cider-ns-reload/-reload-allandcider-ns-refreshbypassed it, so after a reload a buffer kept showing stale/amber markers even though its namespace was actually current again.This extracts the handler's resync into
cider--mark-loadedand calls it from the reload paths for the namespaces that were actually reloaded - gated on the buffer having no unsaved edits, since:reloadloads from disk (an unsaved buffer really is out of sync).cider-ns-refreshcarries the reloaded-namespace list through a per-request cell rather than a global, so concurrent refreshes across REPLs don't clobber each other.One intentional consequence: because this goes through
cider-file-loaded-hook(same as C-c C-k),cider-auto-test-modenow re-runs tests on reload as well. That's called out in the changelog.eldev test)eldev lint)