💡 Hard word-break (overflow-wrap) for overlong words
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- c, typescript
- Área
- cli
Línea de trabajo
Comienza con test/hard-word-break.test.ts, luego inspecciona render_text en src/clayterm.c:269 y el bucle de palabras en clay/clay.h:2559-2564. Confirma que el modo opt-in divide las secuencias demasiado largas en límites de celdas de wcwidth, conserva la disposición solicitada y deja el comportamiento predeterminado de WORDS idéntico byte por byte.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 42
- Forks
- 2
- Merge medio
- 2 d 5 h
- PR fusionados (30 d)
- 12
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bombshell-dev/tty
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
bombshell-dev/tty#61 · 1 reacción ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
bombshell-dev/tty#129 ·
-
question
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
bombshell-dev/tty#112 ·
-
enhancement high priority
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
bombshell-dev/tty#83 · 2 comentarios ·
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
bombshell-dev/tty#82 ·
Todos los issues de bombshell-dev/tty
Issues similares
-
blocklist removal
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
pastelsky/bundlephobia#1122 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100