Repository navigation
fix: keep a BorderElement title with a line break on the top border row [patch] - #188
Merged
Merged
Conversation
…ow [patch] The title was truncated and written as given, so a \n or \r reached the terminal, moved the rest of the title down a row and drew it over the left border. Each line break in the title is now drawn as a space. Fixes #151 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMvgrK1uK13jn4qeVXxDi1
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #151
Before:
BorderElementtruncatedTitleand passed it toWriteAtas given. A title such as"ab\ncd"sent the LF to the terminal, socdwas drawn on the next row over the left│.After: each
\r\n,\ror\nin the title is replaced with a space before truncation, so the title always stays on the top border row. This uses the same three separatorsTextElementsplits on (#135). A space keeps the length the provider clips against equal to the drawn width.Test:
BorderElementRenderTests.TitleWithALineBreakIsDrawnOnOneRowcovers all three separators withRecordingConsoleProvider. It asserts that no write contains\ror\n, and thatab cdis drawn on row 0. All three cases fail onmainand pass with the fix. FullTUI.Testsuite: 227/227.🤖 Generated with Claude Code
https://claude.ai/code/session_01XMvgrK1uK13jn4qeVXxDi1
Generated by Claude Code