Fixed
- Viewport snaps to top of table when entering table-nav — when navigating into a long table from above, the viewport jumped to the top of the table instead of staying in place. During the 80ms entry debounce, Obsidian's native cell editor opens and scrolls the table into view. The plugin now locks
scrollTopvia a scroll event listener during the debounce window to prevent the visual snap entirely, then restores the saved position after table-nav activates. (#136)- Plugin:
src/vim/table-nav-controller.ts(preEntryScrollTopsession field, scroll-lock listener inscheduleEntry,focusWithoutScroll, scroll restore intryEnter+ rAF safety net)
- Plugin:
- Table-nav ignores scrolloff setting — table-nav cell scrolling used hardcoded 5px margins instead of the user's
scrolloffsetting. Withscrolloff=999(typewriter/centered cursor), the highlighted cell stayed at the viewport edge instead of staying centered. Replaced dispatch-basedsyncCursorToActiveCellwith DOM-levelscrollHighlightedCellIntoView(avoids CM6 update cycle side effects) and updatedtableNavScrollHandler— both now read the scrolloff margin viagetScrolloffMargin()with the same half-viewport clamping as the main editor. Structural commands (o,O,dd,J,K, etc.) now scroll the viewport to follow the highlighted cell after row insertion/deletion. (#136)- Plugin:
src/vim/table-nav-controller.ts(scrollHighlightedCellIntoView, replacedsyncCursorToActiveCell,tableNavScrollHandlerusesgetScrolloffMargin,refreshAfterDocChangescrolls after structural ops) - Plugin:
src/vim/scrolloff.ts(newgetScrolloffMargin()export)
- Plugin:
Tests
- 2 new tests in
test/specs/table-nav-scroll.e2e.ts(#136): entering table-nav should not snap viewport to top of table, scrolloff should keep highlighted cell away from viewport edge - Updated
test-vault/fixtures/table-nav/LongTable.mdto 100 rows with 30 lines of leading content
Documentation
CHANGELOG.mdKNOWN_LIMITATIONS.md: marked viewport snap and scrolloff bugs as fixed
Full Changelog: 0.121.0...0.122.0