Skip to content

A justified line that ends its paragraph keeps its words together - #16

Merged
explodi merged 1 commit into
mainfrom
justify-paragraph-last-line
Nov 28, 2026
Merged

explodi merged 1 commit into
mainfrom
justify-paragraph-last-line

Conversation

@explodi

@explodi explodi commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Justified text stretched the last line of each paragraph across the full width when one Text held several paragraphs separated by line breaks (preserveBreaks). Only the last line of the whole text was left alone.

Now a line that ends at a break is set like the last line: from the start, at the words' own spacing. Lines that wrap are justified as before.

Tests

Two new cases in tests/paragraph_test.cpp: a justified line that wraps reaches the far edge, and one that ends its paragraph keeps the spacing of start-aligned text.

Run here: deno fmt --check, deno lint, deno task check, deno task test. The C++ suite was not built in this clone; it ran in a consumer's vendored copy of the same change (the paragraph cases, 42 passing).

@explodi
explodi merged commit f751244 into main Nov 28, 2026
2 checks passed
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