v0.2.1 tui enhancement and better narrow layouts

This commit is contained in:
lixen committed 2026-10-10 11:50:56 -04:00
1 parent 2b5d127e84
commit 7d1c3b24a0
13 files changed
+577 -130

No files matched your search

+3 -1
View File
@@ -258,12 +258,14 @@ func (t *TextFieldState) MoveToEnd() {
// --- Scroll management ---
// AdjustScroll updates scroll to keep cursor visible within viewport width
// AdjustScroll updates scroll to keep the cursor visible within viewport
// width, and the viewport filled up to the end of the text
func (t *TextFieldState) AdjustScroll(viewportW int) {
if viewportW <= 0 {
return
}
t.clampCursor()
t.Scroll = min(t.Scroll, max(0, len(t.Text)+1-viewportW))
if t.Cursor < t.Scroll {
t.Scroll = t.Cursor
}