on main help sign in
fix(ui): cursor mispositioned when pasting large blocks of text in textarea (#2113)
112fea8Ayman Bagabas
internal/ui/model/ui.go+5
@@ -684,8 +684,13 @@ func (m *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
684 cmds = append(cmds, cmd)
684 cmds = append(cmds, cmd)
685 }
685 }
686 case openEditorMsg:
686 case openEditorMsg:
687+ var cmd tea.Cmd
687 m.textarea.SetValue(msg.Text)
688 m.textarea.SetValue(msg.Text)
688 m.textarea.MoveToEnd()
689 m.textarea.MoveToEnd()
690+ m.textarea, cmd = m.textarea.Update(msg)
691+ if cmd != nil {
692+ cmds = append(cmds, cmd)
693+ }
689 case uiutil.InfoMsg:
694 case uiutil.InfoMsg:
690 m.status.SetInfoMsg(msg)
695 m.status.SetInfoMsg(msg)
691 ttl := msg.TTL
696 ttl := msg.TTL