Fixed
- Stale jumpList markers crash vim state on document switch —
gg,G, and other motions withtoJumplist: truethrewRangeError: Invalid position N in document of length Mwhen switching between documents of different lengths (especially with PDF++ plugin). The global jumpList storedMarkerobjects with absolute offsets from the previous (longer) document. WhenjumpList.add()calledcurMark.find()on a stale marker,posFromIndexpassed the old offset todoc.lineAt()without bounds checking, crashing throughprocessMotion→processCommand→ thecm.operation()try-catch, which wiped and re-initialized vim state. Subsequent keystrokes fell through to default CM6 text insertion. (#18)- Fork:
posFromIndexnow clamps offset to[0, doc.length], mirroringindexFromPosbounds checking - Fork:
Marker.find()catches exceptions and returnsnullfor stale markers (all callers already handlenull) - Fork:
Marker.update()catchesRangeErrorfrommapPos()when marker offset exceeds the changeset's starting document length, settingoffset = null - Plugin:
reloadFeatures()now callsvim.resetKeymap()to matchonload()behavior, closing a defense gap where 33 settings-triggered reloads could corrupt the keymap without recovery - 5 new fork tests (posFromIndex clamping, negative offset, valid offset, marker doc-shrink, gg/G with stale jumpList)
- 3 new plugin e2e tests (gg after doc switch, G after doc switch, gg/G after reloadFeatures on shorter doc)
- Fork:
- Visual line mode (V) highlight doesn't match Obsidian theme — the linewise selection highlight used hardcoded rgba colors via the fork's
EditorView.baseTheme, which didn't adapt to Obsidian themes. The fork's&light/&darkCSS variants never activated because Obsidian doesn't addcm-dark/cm-lightclasses to.cm-editor. Added a CSS override instyles.cssusingvar(--text-selection)(Obsidian's accent-derived selection color) at specificity 0-3-0, which beats both the fork's base theme (0-2-0) and Obsidian's code block background (0-2-1) without!important. (#38) - Visual line mode highlight invisible inside code blocks — the linewise selection
Decoration.line()class competed with Obsidian'sHyperMD-codeblock-bgclass on the same.cm-lineelement. The code block background (applied at specificity 0-2-1 via.cm-s-obsidian div.HyperMD-codeblock-bg) won the specificity fight. Fixed by the same CSS override above — specificity 0-3-0 beats 0-2-1. (#38) - Visual block select (Ctrl-V) on EOL displaces cursor rightward —
makeCmSelectionin the fork's block mode branch added+1totoChfor inclusive selection without per-line clamping. When$(end-of-line) settoChto the actual line length,toCh + 1pushed the cursor one position past the last character. Fixed by clampingtoChandfromChto each line's length inside the per-line loop, since each line in a block selection has a different length. The$motion'sInfinityreturn forchis preserved upstream — clamping only happens at the selection-building stage. (#38) - Formatting mark transaction filter corrupts visual selections — the
EditorState.transactionFilterinformatting-mark-fix.tssnapped cursor positions past formatting marks (**,*,`,~~,==) for all selection changes, including visual mode selections. When extending a visual selection across formatted text in Live Preview, the filter'ssnapRangefunction modified the selection head to a formatting mark boundary, causing the selection to jump or collapse unexpectedly. Fixed by adding arange.emptyguard that skips snapping for non-empty (visual) selections — the formatting mark correction is only needed for normal-mode cursor movement. (#38)- Fork:
makeCmSelectionblock mode now clampstoCh/fromChper-line vialineLength(cm, top + i) - Plugin:
formatting-mark-fix.tsskipssnapRangewhenrange.emptyis false - Plugin:
styles.cssadds.cm-editor .cm-line.cm-vim-linewise-selectionoverride withvar(--text-selection)fallback chain
- Fork:
- Visual block
$delete cursor deviation —<C-v>jj$dleaves cursor atch:1instead of Neovim'sch:0after deleting to EOL. This is a pre-existing cursor-after-block-delete positioning issue in the fork (content is correct, only cursor position differs). Registered as a known deviation intest/neovim/deviations.ts.
Documentation
KNOWN_LIMITATIONS.md: updated "Formatting mark cursor correction in Live Preview" section to document the visual mode bypassKNOWN_LIMITATIONS.md: updated "Block visual mode" section test coverage count (13 → 15 golden tests)DIFFERENCES.md(fork): added "Block visual EOL cursor clamping" section documentingmakeCmSelectionper-line clampREADME.md: updated recommended setup to mention theme-aligned visual line highlighting
Full Changelog: 0.25.0...0.26.0