0.83.0
Fixed
- Autocmd mode events only fire in the active editor leaf —
InsertEnter,InsertLeave, andModeChangedautocmd events now fire per-view across all editors (split panes, popover hover-preview editors, canvas card text inputs) when using the bundled vim fork. Previously, these events only fired for the active workspace leaf because theAutocmdManagerbound to a single adapter viaonActiveLeafChange(). Non-leaf editors (popovers, canvas cards) never triggeredactive-leaf-change, so autocmd callbacks for mode events never executed in these contexts. Fixed by addingAutocmdModeWatcher, a CM6ViewPluginthat hooksvim-mode-changeper-EditorView and fires mode events throughAutocmdManager.fire(). The ViewPlugin is registered viaregisterEditorExtension()and automatically applies to all editors. The single-adapter mode-change binding inbindAdapter()andactivate()is gated by auseViewPluginflag — when the ViewPlugin is active (bundled vim mode), the legacy binding is skipped. Built-in vim mode retains the existing active-leaf-only behavior. Other adapter-dependent events (TextYankPost,CursorMoved,CursorHold,CmdlineEnter,CmdlineLeave) remain active-leaf-only for v1. (#88)- Plugin:
src/vim/autocmd-mode-watcher.ts(new —AutocmdModeWatcherViewPlugin,setAutocmdModeCallbacks/clearAutocmdModeCallbacks),src/lua/autocmd.ts(useViewPluginflag,setUseViewPlugin(),handleModeChangeFromView(), guardedonModeChangeinactivate()andbindAdapter()),src/main.ts(extension registration, callback wiring inloadLuaConfigInternal, cleanup inonunload)
- Plugin:
- Hint mode labels missing on wikilinks and markdown links when cursor is on the same line — in Live Preview, wikilinks on the cursor's line render as
.cm-hmd-internal-linkspans (not.cm-underline), and markdown links render as.cm-link/.cm-urlspans. These were not inTARGET_SELECTOR, so no hint labels appeared. In Source mode, wikilinks always render as.cm-hmd-internal-linkand were similarly missed. Fixed by adding.cm-hmd-internal-link,.cm-link, and.cm-urltoOBSIDIAN_SELECTORSand extendingclassifyTarget()to resolve links from these elements via the existingresolveCmUnderlineHref()pipeline. Deduplication filters prevent multiple hints per link: aliased wikilink sub-spans, nested.cm-underlineinside.cm-hmd-internal-link, formatting bracket spans, and markdown link URL spans when a text span exists. (#85)- Plugin:
src/ui/hint-mode.ts(added selectors, extendedclassifyTarget, deduplication filters increateHintAction)
- Plugin:
Tests
- 3 new unit tests in
test/unit/lua/autocmd.test.ts:handleModeChangeFromViewfires events,bindAdapterskips mode-change whenuseViewPluginis true,activateskipsonModeChangewhenuseViewPluginis true - 7 unit tests in
test/unit/vim/autocmd-mode-watcher.test.ts: callback set/clear/overwrite, extension creation, mode payload forwarding, cleanup after clear - 4 e2e tests in
test/specs/lua-autocmd-perview.e2e.ts: InsertEnter fires exactly once in active leaf (no double-firing), InsertEnter fires in non-active split viaVim.handleKey, ModeChanged fires in non-active split with correct pattern, InsertLeave fires in non-active split - Spike tests:
test/specs/spikes/spike-autocmd-multiview.e2e.ts(13 tests — multi-view event discovery),test/specs/spikes/spike-autocmd-popover-timing.e2e.ts(12 tests — popover/timing analysis) - 9 new e2e tests in
test/specs/hint-mode-links.e2e.ts: Source mode navigation (plain, aliased, inline wikilinks), cursor-on-line Live Preview navigation, multiple wikilinks on same line, aliased wikilink deduplication,yfyank on wikilink,Fopen-in-new-tab on wikilink, embed wikilink hint visibility - Mode-switching helpers (
ensureLivePreview,ensureSourceMode,isLivePreview,isSourceMode) extracted totest/helpers.ts - Spike test
test/specs/spikes/spike-hint-wikilink-issue85.e2e.ts: 17 diagnostic tests probing DOM element discovery,posAtDOMmapping accuracy,findLinkAtCursorresolution, and end-to-end hint activation across Live Preview, Source mode, and Reading view
Documentation
CHANGELOG.mdKNOWN_LIMITATIONS.md: Added per-view mode events section documenting which events fire per-view, which remain active-leaf-only,getModeState()semantics, andvim.obsidian.mode()behavior; updated hint mode target classification with.cm-hmd-internal-link,.cm-link,.cm-urlselectors and deduplication filter descriptionsdocs/configuration/lua-config.md: Added per-view callout to autocommands section, markedInsertEnter/InsertLeave/ModeChangedas "(per-view)" in events tabledocs/features/hint-mode.md: Updated internal link handling section with Source mode support and cursor-on-line behaviorCONTRIBUTING.md: Addedautocmd-mode-watcher.tsto codebase structure; updatedhint-mode.tsdescription with cursor-on-line and Source mode link resolutionAGENTS.md: Updated Lua API description noting per-view autocmd mode eventsREADME.md: Updated Lua configuration feature description with per-view mode events
Full Changelog: 0.82.0...0.83.0