summaryrefslogtreecommitdiffhomepage
path: root/internal/tui/tui.go
diff options
context:
space:
mode:
authorKujtim Hoxha <[email protected]>2025-04-23 12:08:45 +0200
committerKujtim Hoxha <[email protected]>2025-04-24 16:40:36 +0200
commit2c5003e3fc94766cf848962ea0ffe94875c35d2b (patch)
treeb822c8161b23b6828b557f5687a1c82b74bd2da4 /internal/tui/tui.go
parent1b22acbc58ffd67b3a42d01bfc320edcb68e5fc7 (diff)
downloadopencode-2c5003e3fc94766cf848962ea0ffe94875c35d2b.tar.gz
opencode-2c5003e3fc94766cf848962ea0ffe94875c35d2b.zip
remove edit/normal mode
Diffstat (limited to 'internal/tui/tui.go')
-rw-r--r--internal/tui/tui.go15
1 files changed, 5 insertions, 10 deletions
diff --git a/internal/tui/tui.go b/internal/tui/tui.go
index 4a723d40d..9744c4cf2 100644
--- a/internal/tui/tui.go
+++ b/internal/tui/tui.go
@@ -30,7 +30,7 @@ type keyMap struct {
var keys = keyMap{
Logs: key.NewBinding(
key.WithKeys("ctrl+l"),
- key.WithHelp("ctrl+L", "logs"),
+ key.WithHelp("ctrl+l", "logs"),
),
Quit: key.NewBinding(
@@ -49,7 +49,7 @@ var keys = keyMap{
Commands: key.NewBinding(
key.WithKeys("ctrl+k"),
- key.WithHelp("ctrl+K", "commands"),
+ key.WithHelp("ctrl+k", "commands"),
),
}
@@ -95,8 +95,6 @@ type appModel struct {
showInitDialog bool
initDialog dialog.InitDialogCmp
-
- editingMode bool
}
func (a appModel) Init() tea.Cmd {
@@ -164,8 +162,6 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
a.initDialog.SetSize(msg.Width, msg.Height)
return a, tea.Batch(cmds...)
- case chat.EditorFocusMsg:
- a.editingMode = bool(msg)
// Status
case util.InfoMsg:
s, cmd := a.status.Update(msg)
@@ -360,7 +356,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
a.showHelp = !a.showHelp
return a, nil
case key.Matches(msg, helpEsc):
- if !a.editingMode {
+ if a.app.CoderAgent.IsBusy() {
if a.showQuit {
return a, nil
}
@@ -477,7 +473,7 @@ func (a appModel) View() string {
)
}
- if a.editingMode {
+ if !a.app.CoderAgent.IsBusy() {
a.status.SetHelpMsg("ctrl+? help")
} else {
a.status.SetHelpMsg("? help")
@@ -494,7 +490,7 @@ func (a appModel) View() string {
if a.currentPage == page.LogsPage {
bindings = append(bindings, logsKeyReturnKey)
}
- if !a.editingMode {
+ if !a.app.CoderAgent.IsBusy() {
bindings = append(bindings, helpEsc)
}
a.help.SetBindings(bindings)
@@ -585,7 +581,6 @@ func New(app *app.App) tea.Model {
permissions: dialog.NewPermissionDialogCmp(),
initDialog: dialog.NewInitDialogCmp(),
app: app,
- editingMode: true,
commands: []dialog.Command{},
pages: map[page.PageID]tea.Model{
page.ChatPage: page.NewChatPage(app),