зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-08 00:15:50 +03:00
fix(wrap): drop phantom whitespace rows for inputs that exactly fill a row
Word-wrap previously emitted a phantom whitespace-only row when a word exactly filled a row and the input continued (e.g. "abcde fghij" at width 5 wrapped to 3 rows instead of 2). Separator whitespace that does not fit the remaining space is now handled like ratatui's WordWrapper (trim: false): whitespace filling the remaining cells is dropped, whitespace after an exactly full row is dropped one grapheme at a time, and any leftover whitespace leads the next row. wrapped_rows now keeps byte-accurate column bookkeeping so screen_map round-trips hold for all visible positions; positions inside dropped whitespace have no screen representation and are treated as such. Verified differentially against ratatui 0.30's WordWrapper (a faithful reference port cross-checked against the real Paragraph renderer): row counts now match for single- and multi-space separators, trailing whitespace, CJK and mixed-width inputs.
Этот коммит содержится в:
2
Cargo.lock
сгенерированный
2
Cargo.lock
сгенерированный
@@ -1871,7 +1871,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tui-textarea-2"
|
||||
version = "0.12.1"
|
||||
version = "0.12.2"
|
||||
dependencies = [
|
||||
"arbitrary",
|
||||
"crossterm 0.28.1",
|
||||
|
||||
Ссылка в новой задаче
Block a user