make ctrl+d quit too, just like shells (#105)

This commit is contained in:
Gal Schlezinger 2025-06-15 01:56:34 +03:00 committed by GitHub
parent 2ea0399aa7
commit adb54521b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -124,6 +124,11 @@ func (m *editorComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return nil
}
}
case "ctrl+d":
if m.textarea.Value() != "" {
return m, nil
}
return m, tea.Quit
case "shift+enter":
value := m.textarea.Value()
m.textarea.SetValue(value + "\n")