feat(tui): more ways to quit

This commit is contained in:
adamdotdevin 2025-07-16 14:20:19 -05:00
parent 93c779cf48
commit f7dd48e60d
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
4 changed files with 8 additions and 10 deletions

View file

@ -344,6 +344,12 @@ func (m *editorComponent) Submit() (tea.Model, tea.Cmd) {
if value == "" {
return m, nil
}
switch value {
case "exit", "quit", "q", ":q":
return m, tea.Quit
}
if len(value) > 0 && value[len(value)-1] == '\\' {
// If the last character is a backslash, remove it and add a newline
m.textarea.ReplaceRange(len(value)-1, len(value), "")