Commit 23bd724
feat(plugins): adopt config_changed in git_explorer and vi_mode
The two shipped plugins whose settings could not take effect until the
editor restarted. Both needed more than "re-read the value":
git_explorer already re-read `colorNames` — but only inside
`refreshGitExplorerDecorations`, which runs on file open/save/explorer
change/init/focus. Nothing re-ran it on a settings save, so ticking the
box left the explorer painted with the old colors until the user
happened to save a file. One more subscription, alongside its five
existing ones.
vi_mode bakes `arrowKeys` and `searchWordUnderCursor` into the mode
binding tables at `defineMode` time, so re-reading them changes nothing
by itself — the modes have to be re-emitted. The seven top-level
`defineMode` calls move into `defineViModes()`, called at load and again
from the `config_changed` handler when either value actually changed.
Re-emitting is safe: `handle_define_mode` clears the mode's existing
plugin defaults before re-registering, so the call is idempotent.
`autoStart` is deliberately left load-time. It means "enable vi when the
editor starts"; switching vi on mid-session because a startup preference
changed is a different behaviour than the setting promises, and that's
the maintainer's call, not a bug fix.
Audited every other shipped plugin. flash (`labelPool`, `skipRule`) and
dashboard (`autoOpen`) already read at point of use and need nothing;
pkg and theme_editor read host config inside functions, likewise. The
orchestrator dock's settings live on their own branch and get the same
treatment there.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CstcifC5JjgznkUK8L8dm21 parent 2332bdc commit 23bd724
4 files changed
Lines changed: 633 additions & 377 deletions
File tree
- crates/fresh-editor
- plugins
- tests/e2e/plugins
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
243 | 249 | | |
244 | 250 | | |
0 commit comments