Skip to content

Resync load-state indicators after namespace reloads - #3980

Merged
bbatsov merged 1 commit into
masterfrom
ns-reload-resyncs-indicators
Jun 20, 2026
Merged

Resync load-state indicators after namespace reloads#3980
bbatsov merged 1 commit into
masterfrom
ns-reload-resyncs-indicators

Conversation

@bbatsov

@bbatsov bbatsov commented Jun 20, 2026

Copy link
Copy Markdown
Member

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-all and cider-ns-refresh bypassed 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-loaded and calls it from the reload paths for the namespaces that were actually reloaded - gated on the buffer having no unsaved edits, since :reload loads from disk (an unsaved buffer really is out of sync). cider-ns-refresh carries 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-mode now re-runs tests on reload as well. That's called out in the changelog.


  • The commits are consistent with our contribution guidelines
  • You've added tests to cover your change(s)
  • All tests are passing (eldev test)
  • All code passes the linter (eldev lint)
  • You've updated the changelog
  • You've updated the user manual (n/a - behavior fix, no new commands/options)

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'.
@bbatsov
bbatsov merged commit 25d94dc into master Jun 20, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant