|
@@ -69,7 +69,6 @@ type appModel struct {
|
|
|
fileProvider dialog.CompletionProvider
|
|
fileProvider dialog.CompletionProvider
|
|
|
symbolsProvider dialog.CompletionProvider
|
|
symbolsProvider dialog.CompletionProvider
|
|
|
showCompletionDialog bool
|
|
showCompletionDialog bool
|
|
|
- fileCompletionActive bool
|
|
|
|
|
leaderBinding *key.Binding
|
|
leaderBinding *key.Binding
|
|
|
// isLeaderSequence bool
|
|
// isLeaderSequence bool
|
|
|
toastManager *toast.ToastManager
|
|
toastManager *toast.ToastManager
|
|
@@ -155,7 +154,6 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|
|
!a.showCompletionDialog &&
|
|
!a.showCompletionDialog &&
|
|
|
a.editor.Value() == "" {
|
|
a.editor.Value() == "" {
|
|
|
a.showCompletionDialog = true
|
|
a.showCompletionDialog = true
|
|
|
- a.fileCompletionActive = false
|
|
|
|
|
|
|
|
|
|
updated, cmd := a.editor.Update(msg)
|
|
updated, cmd := a.editor.Update(msg)
|
|
|
a.editor = updated.(chat.EditorComponent)
|
|
a.editor = updated.(chat.EditorComponent)
|
|
@@ -174,7 +172,6 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|
|
if keyString == "@" &&
|
|
if keyString == "@" &&
|
|
|
!a.showCompletionDialog {
|
|
!a.showCompletionDialog {
|
|
|
a.showCompletionDialog = true
|
|
a.showCompletionDialog = true
|
|
|
- a.fileCompletionActive = true
|
|
|
|
|
|
|
|
|
|
updated, cmd := a.editor.Update(msg)
|
|
updated, cmd := a.editor.Update(msg)
|
|
|
a.editor = updated.(chat.EditorComponent)
|
|
a.editor = updated.(chat.EditorComponent)
|
|
@@ -191,7 +188,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|
|
|
|
|
|
|
if a.showCompletionDialog {
|
|
if a.showCompletionDialog {
|
|
|
switch keyString {
|
|
switch keyString {
|
|
|
- case "tab", "enter", "esc", "ctrl+c", "up", "down":
|
|
|
|
|
|
|
+ case "tab", "enter", "esc", "ctrl+c", "up", "down", "ctrl+p", "ctrl+n":
|
|
|
updated, cmd := a.completions.Update(msg)
|
|
updated, cmd := a.completions.Update(msg)
|
|
|
a.completions = updated.(dialog.CompletionDialog)
|
|
a.completions = updated.(dialog.CompletionDialog)
|
|
|
cmds = append(cmds, cmd)
|
|
cmds = append(cmds, cmd)
|
|
@@ -356,7 +353,6 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|
|
cmds = append(cmds, cmd)
|
|
cmds = append(cmds, cmd)
|
|
|
case dialog.CompletionDialogCloseMsg:
|
|
case dialog.CompletionDialogCloseMsg:
|
|
|
a.showCompletionDialog = false
|
|
a.showCompletionDialog = false
|
|
|
- a.fileCompletionActive = false
|
|
|
|
|
case opencode.EventListResponseEventInstallationUpdated:
|
|
case opencode.EventListResponseEventInstallationUpdated:
|
|
|
return a, toast.NewSuccessToast(
|
|
return a, toast.NewSuccessToast(
|
|
|
"opencode updated to "+msg.Properties.Version+", restart to apply.",
|
|
"opencode updated to "+msg.Properties.Version+", restart to apply.",
|
|
@@ -1043,7 +1039,6 @@ func NewModel(app *app.App) tea.Model {
|
|
|
symbolsProvider: symbolsProvider,
|
|
symbolsProvider: symbolsProvider,
|
|
|
leaderBinding: leaderBinding,
|
|
leaderBinding: leaderBinding,
|
|
|
showCompletionDialog: false,
|
|
showCompletionDialog: false,
|
|
|
- fileCompletionActive: false,
|
|
|
|
|
toastManager: toast.NewToastManager(),
|
|
toastManager: toast.NewToastManager(),
|
|
|
interruptKeyState: InterruptKeyIdle,
|
|
interruptKeyState: InterruptKeyIdle,
|
|
|
exitKeyState: ExitKeyIdle,
|
|
exitKeyState: ExitKeyIdle,
|