xonecas.io
62159
Sy

symb / commit bc98c83

fix: scroll fix

xonecas2026-02-11 bc98c830aa418aaea6d499517095288f3476998b parent 0ea1205

2 files changed

internal/tui/textarea/textarea.go+8−3
@@ -1151,16 +1151,21 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
11511151 }
11521152
11531153 newRow, newCol := m.cursorLineNumber(), m.col
1154+ cursorMoved := (newRow != oldRow || newCol != oldCol)
1155+
11541156 var cmd tea.Cmd
11551157 m.Cursor, cmd = m.Cursor.Update(msg)
1156- if (newRow != oldRow || newCol != oldCol) && m.Cursor.Mode() == cursor.CursorBlink {
1158+ if cursorMoved && m.Cursor.Mode() == cursor.CursorBlink {
11571159 m.Cursor.Blink = false
11581160 cmd = m.Cursor.BlinkCmd()
11591161 }
11601162 cmds = append(cmds, cmd)
11611163
1162- // Reposition viewport BEFORE viewport.Update to avoid race condition
1163- m.repositionView()
1164+ // Only reposition viewport when cursor actually moved
1165+ // This allows manual scrolling without cursor anchoring
1166+ if cursorMoved {
1167+ m.repositionView()
1168+ }
11641169
11651170 vp, cmd := m.viewport.Update(msg)
11661171 m.viewport = &vp
internal/tui/tui.go+2−2
@@ -392,13 +392,13 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
392392 if maxScroll < 0 {
393393 maxScroll = 0
394394 }
395- m.conversationScrollOffset += 3 // Scroll 3 lines at a time
395+ m.conversationScrollOffset += 1 // Scroll 1 line at a time
396396 if m.conversationScrollOffset > maxScroll {
397397 m.conversationScrollOffset = maxScroll
398398 }
399399
400400 case tea.MouseButtonWheelDown:
401- m.conversationScrollOffset -= 3 // Scroll 3 lines at a time
401+ m.conversationScrollOffset -= 1 // Scroll 1 line at a time
402402 if m.conversationScrollOffset < 0 {
403403 m.conversationScrollOffset = 0
404404 }