mirror of
https://github.com/IllusionMan1212/gorc.git
synced 2026-10-24 02:12:33 +00:00
refactor: handle slash commands in a separate function
* quit gorc when "/quit" is sent * move tea commands into their own package * other small fixes
This commit is contained in:
+2
-1
@@ -23,6 +23,7 @@ import (
|
||||
"github.com/charmbracelet/bubbles/textinput"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/illusionman1212/gorc/cmds"
|
||||
"github.com/illusionman1212/gorc/ui"
|
||||
)
|
||||
|
||||
@@ -79,7 +80,7 @@ func (s State) Update(msg tea.Msg) (State, tea.Cmd) {
|
||||
case " ", "enter":
|
||||
// run the newClient cmd when pressing "enter" while focused on the connect button
|
||||
if key == "enter" && s.FocusIndex == len(s.Inputs)+1 {
|
||||
return s, connect
|
||||
return s, cmds.Connect
|
||||
}
|
||||
|
||||
// toggle tls state when pressing "enter" or "space" while focused on the checkbox
|
||||
|
||||
Reference in New Issue
Block a user