Repository navigation
A big squash 🫧
A patch release with a whole lot of patches! Over 40 fixes across nearly every component, most of them from the community. Text inputs handle wide characters better, viewports respect their borders, and timers keep honest time.
Text Input
- The cursor stays in the right place with wide characters and when the value is scrolled.
- Shows the full placeholder when no width is set.
- Suggestions refresh when you set the value, and completions stay within the input's width.
- No more out-of-range suggestion index.
- Deleting the next word stops at the end of that word.
- The virtual cursor now uses your
TextStyle. - Shift+Backspace deletes, too, for terminals using the kitty keyboard protocol.
- Clipboard errors wrap the original error, so
errors.Isworks.
Text Area
- Moves and deletes by whole characters, so emoji and other combined characters stay intact.
CharLimitcounts characters, not screen width, so a CJK character no longer counts double.- A word that exactly fills a line stays on it.
- The cursor can reach wrapped lines at the end of the text.
- The view follows the cursor after
SetValue. - Autoresize keeps the first wrapped line visible.
- The first inserted line is counted once when measuring height.
- Always keeps at least one column for text, even when
MaxWidthis tiny. - The placeholder no longer renders twice.
- Shift+Backspace and clipboard error fixes, same as Text Input.
Viewport
- Pages by the height you can actually see when the style has a border or padding.
ScrollPercentaccounts for borders and padding.- Highlights line up on content that's already styled.
Table
SetCursorscrolls to keep the selected row visible.- The view stays put when you step past the last row.
SetRowswith no rows resets the cursor to the top.- Extra cells in a row are ignored instead of breaking the layout.
List
qandescare back as the default quit keys.- Titles without a status message are no longer cut off.
- Fuzzy matches highlight the right characters with non-English text.
- Removing an item while filtering keeps the filtered list in sync.
Timer ⏱️
- Calling
Startmore than once no longer makes the timer count down faster. - Leftover ticks from an earlier start are now really ignored.
Stopwatch
- Elapsed time follows the actual clock, so slow updates can't make it fall behind.
New()defaults to a one-second interval, just like the docs always said.
Progress
- Percentages out of range are clamped before animating and rendering.
- Fixed a race in the animation.
File Picker
- The selection stays valid while entries load.
- No more stray extra newline.
Help
- Short help stays within its width.
- Full help columns are styled properly, padding included.
Tree
SetValueupdates what's rendered.SetNodesaccepts anilroot.
Paginator
- An invalid page size leaves pagination as it was instead of breaking it.
Big thanks to everyone who contributed, and an extra big welcome to the huge crowd of first-time contributors! This release is mostly yours 🫶
Read the details below 👇🏻
Have a less buggy weekend,
Charm XX 🌊
Changelog
Fixed
- c94fcfd: fix(filepicker): keep the selection valid while entries load (#1093) (@janearc)
- 5bc76ae: fix(filepicker): remove loop iteration appending extra newline (#914) (@bntrtm)
- 18dcd80: fix(help): keep the short help within its width (#1066) (@iainlane)
- 48be6e2: fix(help): style full help column padding (#989) (@Yongcheng123)
- ed22992: fix(list): RemoveItem correctly updates the filtered list when a filter is active (#997) (@troclaux)
- 74a6322: fix(list): avoid truncating titles without status (#1048) (@imshunsuke)
- 3bf6c63: fix(list): convert fuzzy match indexes from byte to rune offsets (#1014) (@upuddu)
- 19ed085: fix(list): restore the default quit keys (#1046) (@justadityaraj)
- 5629869: fix(paginator): leave pagination unchanged when the page size is invalid (#1091) (@janearc)
- e04077d: fix(progress): eliminate race in nextFrame (#1077) (@rapropos)
- 77c1de1: fix(progress): normalize percentages before animating and rendering (#1082) (@shayanxcyber)
- 7887706: fix(stopwatch): derive elapsed from wall clock (#1069) (@TastyHeadphones)
- 2dd9752: fix(table): adjust viewport offset in SetCursor to keep cursor row visible (#1064) (@AdamMagued)
- 4f8ed71: fix(table): clamp cursor to 0 when SetRows is called with empty slice (#1003) (@LeSingh1)
- 4c0b283: fix(table): ignore extra cells when rendering rows (#1092) (@janearc)
- 96c3466: fix(table): keep the viewport in place when stepping across the last row (#1054) (@cabbagekobe)
- 266927c: fix(textarea): count first inserted line once in content height (#1088) (@peterolkhov)
- 62411cf: fix(textarea): count runes, not display width, for CharLimit (#1008) (@sueun-dev)
- 273e7bd: fix(textarea): keep a last word that exactly fills the line (#1070) (@abdull-ah-med)
- b2b782e: fix(textarea): keep one column for text when MaxWidth is too small (#1095) (@janearc)
- b6938b6: fix(textarea): navigate and delete whole graphemes (#1067) (@rupayon123)
- a76b63e: fix(textarea): reach trailing wrapped cursor lines (#1051) (@LeulTew)
- eea953c: fix(textarea): remove double rendering in placeholder view (#911) (@spxzx)
- 9f3f429: fix(textarea): reposition view after SetValue (#998) (@troclaux)
- 43e4df9: fix(textinput): apply missing .TextStyle to virtualCursor (#967) (@marvinlanhenke)
- b371c6b: fix(textinput): cap suggestion completion to input width (#1055) (@timatigoogl3-code)
- a348bd7: fix(textinput): keep suggestion index non-negative (#1084) (@sameerihs)
- f9981e0: fix(textinput): keep the cursor position correct for wide characters and scrolled values (#1087) (@shounakjoshi88-a11y)
- bf6c054: fix(textinput): refresh suggestions when setting the value (#1096) (@janearc)
- 2ffd48b: fix(textinput): show full placeholder when Width is not set (#988) (@troclaux)
- 8f9db15: fix(textinput): stop forward word deletion at word boundary (#1058) (@rupayon123)
- bf2f980: fix(timer): make tag debounce actually reject stale ticks (#1012) (@momomuchu)
- ee29549: fix(timer): prevent Start() from spawning multiple tickers (#922) (@Aliexe-code)
- d4ae900: fix(tree): let SetNodes accept a nil root (#1094) (@janearc)
- 65f99f0: fix(tree): update rendered node values in SetValue (#1052) (@jakezwang)
- 01b9d49: fix(viewport): account for the style frame in ScrollPercent (#1086) (@yxshee)
- 8add387: fix(viewport): correct highlight offsets on ANSI-styled content (#1050) (@rksharma-owg)
- 8e65b5c: fix(viewport): page by the visible height when the style has a frame (#1085) (@yxshee)
Other stuff
- 4e3dc76: ci: lint (#1099) (@andrinoff)
- 3815b7b: feat(textinput,textarea): add shift+backspace support (#972) (@jabagawee)
- 0511907: fix(textinput,textarea): implement Unwrap on clipboard error messages (#1063) (@AdamMagued)
- 99653d3: textarea: keep first soft-wrapped row visible after autoresize (#913) (@yogirk)
- 0c1a491: v2.2.2 (@andrinoff)
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
