Repository navigation
v1.18.4
Fixed
-
Scroll math is now in visual rows, not logical lines. 1.18.3 fixed
the scroll-time line reveal for soft-broken paragraphs but the bug
survived for single source lines that were themselves wider than the
viewport — exactly what happens in documents with prose paragraphs
written as one long physical line (common in note-taking tools).
User reproduction: a 180-char line at source line 105 in
personal_notes.mdwrapped visually butblock.height()still
returned 1, so scrolling past it shifted the following table by the
missing rows.The fix moves the entire coordinate system to visual rows:
DocBlock::height()now returns wrapped visual-row counts for
Textblocks (via a newvisual_height: Cell<u32>), recomputed on
every layout-width change byupdate_text_visual_heights.scroll_offset,cursor_line,total_lines, and the visual
selection range are all in visual rows.j/kmove by one
visual row, matching pager conventions (less,bat) rather than
strict vim logical-line semantics.- Text blocks render via
Paragraph::new(full_text).scroll((N, 0))
instead of slicing by logical line, so ratatui's wrap and our
scroll math agree on what's visible. recompute_positionstranslates logical-in-block link and anchor
indices to absolute visual rows so theflink picker and TOC
jumps still land on the right row under wrapping.collect_match_linesrecords matches in visual rows son/N
doc-search navigation jumps don't drift when wrapped paragraphs
sit between matches.source_line_atandlogical_line_at_sourcegain width-aware
variants (_width) used everywhere that converts between cursor
position and source-line number (edit mode entry,yy/ visual
yank, link-picker line filtering).
Gutter line numbers now track logical source lines (with blank
continuation rows) rather than absolute visual rows, so long
paragraphs show a single number on the first wrap row and blanks
below — the correspondence users expect from an editor/pager.