Skip to content

Open files that contain U+2029 - #13

Merged
dhh merged 2 commits into
masterfrom
open-paragraph-separators
Nov 12, 2026
Merged

dhh merged 2 commits into
masterfrom
open-paragraph-separators

Conversation

@dhh

@dhh dhh commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Plain refused any file with a U+2029 paragraph separator in it, since QTextDocument uses that character to separate its blocks and would have turned it into a line break. Even Plain's own FindBar.qml couldn't be opened.

Now a U+2029 is held in the editor as U+FDEF and turned back on save, so the file round-trips byte for byte. U+FDEF is a Unicode noncharacter, set aside for a program's internal use, so typed or pasted text won't carry one (U+FDD0 is out, since Qt uses it to begin a frame). Only a file that already contains U+FDEF is refused, since saving would change it. The stand-in likely shows as a placeholder glyph, and copying it puts U+FDEF on the clipboard.

FindBar.qml now spells its own U+2029 as "
" instead of the invisible character.

🤖 Generated with Claude Code

QTextDocument separates its blocks with U+2029, so Plain refused any file
holding one rather than turn it into a line break. Hold it in the editor as a
private-use stand-in, U+E029, and turn it back on save, so the file round-trips
byte for byte. Only a file that already holds the stand-in is refused now.

FindBar.qml spells its own U+2029 as an escape rather than the invisible
character.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No new blocking issue was found in the latest changes.

Summary

Plain can open files containing U+2029 by holding that character as U+FDEF and restoring it on save.

  • Files with paragraph marks now open without turning them into line breaks.

Reviews (2) · Last reviewed commit: "Stand U+2029 in with a noncharacter rath..." · Reviewed by Greptile

Comment thread src/document.cpp Resolved
A private-use character could be pasted or typed in and would then be saved as
U+2029. U+FDEF is a noncharacter, set aside for a program's own use, so text
won't hold one. Not U+FDD0, which Qt already uses to begin a frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhh
dhh merged commit 566bf55 into master Nov 12, 2026
2 checks passed
@dhh
dhh deleted the open-paragraph-separators branch November 12, 2026 14:29
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