on main help sign in
fix(bangmode): sync bang mode with external editor

๐Ÿ’˜ Generated with Crush Assisted-by: Crush:qwen3.7-max

commitd20e29ae75004991e801fc4fd18c83e68913b5ab authorChristian Rocha <christian@rocha.is> dateFri 19 Jun 2026, 20:29 (4 months ago) parentf342edf
1 file changed+11โˆ’2
internal/ui/model/ui.go+11โˆ’2
internal/ui/model/ui.go+11โˆ’2
@@ -966,6 +966,7 @@ func (m *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
966966 prevHeight := m.textarea.Height()
967967 m.textarea.SetValue(msg.Text)
968968 m.textarea.MoveToEnd()
969+ m.syncBangModeFromTextarea()
969970 cmds = append(cmds, m.updateTextareaWithPrevHeight(msg, prevHeight))
970971 case shellStreamMsg:
971972 if item := m.chat.MessageItem(msg.PendingID); item != nil {
@@ -1557,7 +1558,11 @@ func (m *UI) handleDialogMsg(msg tea.Msg) tea.Cmd {
15571558 cmds = append(cmds, util.ReportWarn("Agent is working, please wait..."))
15581559 break
15591560 }
1560โˆ’ cmds = append(cmds, m.openEditor(m.textarea.Value()))
1561+ editorValue := m.textarea.Value()
1562+ if m.bangMode {
1563+ editorValue = "!" + editorValue
1564+ }
1565+ cmds = append(cmds, m.openEditor(editorValue))
15611566 m.dialog.CloseDialog(dialog.CommandsID)
15621567 case dialog.ActionToggleCompactMode:
15631568 cmds = append(cmds, m.toggleCompactMode())
@@ -2117,7 +2122,11 @@ func (m *UI) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
21172122 cmds = append(cmds, util.ReportWarn("Agent is working, please wait..."))
21182123 break
21192124 }
2120โˆ’ cmds = append(cmds, m.openEditor(m.textarea.Value()))
2125+ editorValue := m.textarea.Value()
2126+ if m.bangMode {
2127+ editorValue = "!" + editorValue
2128+ }
2129+ cmds = append(cmds, m.openEditor(editorValue))
21212130 case key.Matches(msg, m.keyMap.Editor.Newline):
21222131 prevHeight := m.textarea.Height()
21232132 m.textarea.InsertRune('\n')