Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/tui/composer.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (m model) composerPositionAtVisualCell(x int, y int, width int) (int, bool)
func (m model) applyComposerKey(msg tea.KeyMsg) (model, bool) {
state := m.currentComposerState()
switch {
case keyIs(msg, tea.KeyEnter) && keyAlt(msg):
case keyIs(msg, tea.KeyEnter) && (keyAlt(msg) || keyShift(msg)):
m = m.insertComposerTextWithPastePreview(state, "\n", "")
case keyCtrl(msg, 'j'):
m = m.insertComposerTextWithPastePreview(state, "\n", "")
Expand Down
3 changes: 2 additions & 1 deletion internal/tui/composer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ func TestModifiedEnterInsertsNewlineWithoutSubmitting(t *testing.T) {
key tea.Msg
}{
{name: "alt enter", key: testKeyAlt(tea.KeyEnter)},
{name: "shift enter", key: testKeyCtrl('j')},
{name: "shift enter", key: testKeyShift(tea.KeyEnter)},
{name: "ctrl j", key: testKeyCtrl('j')},
}

for _, tc := range tests {
Expand Down
2 changes: 1 addition & 1 deletion internal/tui/keybinding_help.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (m model) buildKeybindingGroups() []keybindingGroup {
title: "Chat",
bindings: []keybinding{
{"Enter", "send the message"},
{"Alt+Enter", "insert a newline (multi-line compose)"},
{"Shift+Enter / Alt+Enter", "insert a newline (multi-line compose)"},
{"Esc (\u00d72)", "cancel the run / dismiss a popup / clear the input"},
{"Ctrl+C", "cancel the run, then quit"},
{"?", "show this help (on an empty input)"},
Expand Down
2 changes: 1 addition & 1 deletion internal/tui/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ func (m model) updateModel(msg tea.Msg) (tea.Model, tea.Cmd) {
if m.picker != nil {
return m.choosePicker()
}
if keyAlt(msg) {
if keyAlt(msg) || keyShift(msg) {
if next, ok := m.applyComposerKey(msg); ok {
return next, nil
}
Expand Down
Loading