on main help sign in
feat: increase paste lines as attachment threshold (#1936)

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

commit4086e2f007ac54f1785535546f0fc0bae47afada authorCarlos Alexandro Becker <caarlos0@users.noreply.github.com> dateWed 21 Jan 2026, 17:16 (9 months ago) parentb66676c
1 file changed+4−2
internal/tui/components/chat/editor/editor.go+4−2
internal/tui/components/chat/editor/editor.go+4−2
@@ -39,6 +39,9 @@ var (
3939 errClipboardUnknownFormat = fmt.Errorf("unknown clipboard format")
4040)
4141
42+// If pasted text has more than 10 newlines, treat it as a file attachment.
43+const pasteLinesThreshold = 10
44+
4245type Editor interface {
4346 util.Model
4447 layout.Sizeable
@@ -239,8 +242,7 @@ func (m *editorCmp) Update(msg tea.Msg) (util.Model, tea.Cmd) {
239242 m.textarea.SetValue(msg.Text)
240243 m.textarea.MoveToEnd()
241244 case tea.PasteMsg:
242− // If pasted text has more than 2 newlines, treat it as a file attachment.
243− if strings.Count(msg.Content, "\n") > 2 {
245+ if strings.Count(msg.Content, "\n") > pasteLinesThreshold {
244246 content := []byte(msg.Content)
245247 if len(content) > maxAttachmentSize {
246248 return m, util.ReportWarn("Paste is too big (>5mb)")