Repository navigation
v0.2.0-alpha
Pre-release
Pre-release
·
25 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Added
linesInViewport()method - Query which lines are visible in viewport (no side effects), returnsViewportLineInfowithfullyVisibleandpartiallyVisiblerangesisLineRendered(n)method - Check if a line is rendered in DOM (no side effects)isLineVisible(n, partial?)method - Check if a line is visible in viewport (no side effects)documentLineNumber(locator)method - Get 1-based document line number for a line elementfirstVisibleLine()method - Get first actually-visible line (skips anchor lines)scrollToLine()position options - Control where line appears:'top','center','bottom', or numeric 0-1LineRangetype - Range of line numbers withfirstandlastpropertiesViewportLineInfotype - Viewport line information withfullyVisibleandpartiallyVisiblearraysScrollLinePositiontype - Position option forscrollToLine()ScrollToLineOptionstype - Options forscrollToLine()includingpositionandwaitForIdle
Changed
- Renamed
linestolinesInDOM- Clarifies these are DOM elements (may include off-screen anchor lines) - Renamed
materializedLine(n)tolineInDOMAt(n)- Clarifies it's a DOM index, not document line number - Renamed
materializedLineContaining()tolineInDOMContaining()- Consistent naming - Renamed
lineVisible()toscrollToLineAndLocate()- Name reveals side effect (scrolls before returning) - Renamed
scrollLineIntoView()toscrollToLine()- Simpler name - Renamed
toHaveVisibleLineCount()totoHaveDOMLineCount()- Consistent withlinesInDOM - Documentation notes about virtual rendering -
linesInDOMmay NOT be contiguous (CodeMirror keeps anchor lines like line 1 in DOM with.cm-gapspacers)
Breaking Changes
linesrenamed tolinesInDOMmaterializedLine(n)renamed tolineInDOMAt(n)and is now 0-indexed (was 1-indexed)materializedLineContaining()renamed tolineInDOMContaining()lineVisible()renamed toscrollToLineAndLocate()scrollLineIntoView()renamed toscrollToLine()toHaveVisibleLineCount()renamed totoHaveDOMLineCount()