mirror of
https://github.com/sst/opencode.git
synced 2025-07-24 08:15:04 +00:00
feat(tui): more ways to quit
This commit is contained in:
parent
93c779cf48
commit
f7dd48e60d
4 changed files with 8 additions and 10 deletions
|
@ -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), "")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue