Skip to content

fix(display): avoid extra row on exact-width softwrap lines - #4217

Open
dlh wants to merge 1 commit into
micro-editor:masterfrom
dlh:fix/softwrap-extra-blank-row
Open

dlh wants to merge 1 commit into
micro-editor:masterfrom
dlh:fix/softwrap-extra-blank-row

Conversation

@dlh

@dlh dlh commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

A line whose rendered width exactly filled the window would push the next line down by an extra, blank wrapped row.

Wrapping is now suppressed for such lines, except when a cursor is parked at the line's end: without the wrapped row there is nowhere to draw that cursor, so it is kept for that frame to stay visible.

Example

Given the following text:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
SECOND LINE - should be right below, no gap
third line

Before fix

An extra blank row appears between the first and second lines.
before-fix

After fix

The second line now appears immediately below the first line, with no extra blank row.
after-fix

@dlh
dlh force-pushed the fix/softwrap-extra-blank-row branch 2 times, most recently from 7c2166a to 28ace02 Compare September 9, 2026 16:50
@dlh
dlh force-pushed the fix/softwrap-extra-blank-row branch from 28ace02 to 870fdfe Compare September 17, 2026 01:27
A line whose rendered width exactly filled the window would push the
next line down by an extra, blank wrapped row.

Wrapping is now suppressed for such lines, except when a cursor is
parked at the line's end: without the wrapped row there is nowhere to
draw that cursor, so it is kept for that frame to stay visible.
@dlh
dlh force-pushed the fix/softwrap-extra-blank-row branch from 870fdfe to b826042 Compare September 17, 2026 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant