💡 Hard word-break (overflow-wrap) for overlong words
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 68/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- c, typescript
- 領域
- cli
調査の方向性
test/hard-word-break.test.ts から始め、次に src/clayterm.c:269 の render_text と clay/clay.h:2559-2564 のワードループを調べてください。オプトインモードが長すぎる連続部分を wcwidth のセル境界で分割し、要求されたレイアウトを維持し、デフォルトの WORDS の動作をバイト単位で完全に同一に保つことを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem?
WORDS wrap only breaks at whitespace, so a single word wider than the content box is emitted as one over-wide line that bleeds past the box with no way to break inside it. In a 10-wide bordered box (8 cols of content), "Hellooooooooooooo World" lays out as one long line that spills onto the top-border row entirely outside the box—row 0 prints ┌────────┐oooooooo W while every interior row is blank.
Describe the solution you'd like
An opt-in hard-break mode that mirrors the CSS overflow-wrap property: when a word's measured width exceeds the content width, split at the overflowing cell and continue on the next line until the remainder fits. At width 8, "Hellooooooooooooo World" becomes Helloooo / oooooooo / o World. One extra wrap value or a breakWord flag (exact name TBD):
text("Hellooooooooooooo World", { wrap: 3 }); // WORDS + hard-break
text("Hellooooooooooooo World", { breakWord: true });
Wide runs must split on cell boundaries, not bytes, to stay correct with wcwidth. Default WORDS behavior must stay byte-for-byte identical.
Describe alternatives you've considered
Pre-segmenting overlong runs in JS before text(): unreliable, since it would re-implement wcwidth-aware measurement and need the laid-out content width before layout exists. The break has to happen where the width is known, in the measurement pass.
Additional context
Failing test case on nm/repro/hard-word-break (test · diff). Likely lives in src/clayterm.c:269, where render_text advances x += cw per glyph with no content-width clamp, with the mid-word split landing in Clay's word loop at clay/clay.h:2559-2564.
- 主要言語
- TypeScript
- スター
- 42
- フォーク
- 2
- 平均マージ
- 2日 5時間
- マージ済み PR(30日)
- 12
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bombshell-dev/tty のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
bombshell-dev/tty#61 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
bombshell-dev/tty#129 ·
-
question
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
bombshell-dev/tty#112 ·
-
enhancement high priority
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
bombshell-dev/tty#83 · コメント 2 件 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
bombshell-dev/tty#82 ·
bombshell-dev/tty の issue をすべて見る
似ている issue
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Crush オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
ElementsProject/cln-application#167 · コメント 1 件 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Quantco/pnpm-licenses#17 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100