Skip to content

Commit 22d2119

Browse files
committed
Bind Shift-Enter to insertNewlineAndIndent
FIX: Bind Shift-Enter to the same command as Enter in the default keymap, so that it doesn't do nothing when on an EditContext-supporting browser. Closes codemirror/dev#1447
1 parent d0c97ba commit 22d2119

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/commands.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ export const emacsStyleKeymap: readonly KeyBinding[] = [
918918
/// - End: [`cursorLineBoundaryForward`](#commands.cursorLineBoundaryForward) ([`selectLineBoundaryForward`](#commands.selectLineBoundaryForward) with Shift)
919919
/// - Ctrl-Home (Cmd-Home on macOS): [`cursorDocStart`](#commands.cursorDocStart) ([`selectDocStart`](#commands.selectDocStart) with Shift)
920920
/// - Ctrl-End (Cmd-Home on macOS): [`cursorDocEnd`](#commands.cursorDocEnd) ([`selectDocEnd`](#commands.selectDocEnd) with Shift)
921-
/// - Enter: [`insertNewlineAndIndent`](#commands.insertNewlineAndIndent)
921+
/// - Enter and Shift-Enter: [`insertNewlineAndIndent`](#commands.insertNewlineAndIndent)
922922
/// - Ctrl-a (Cmd-a on macOS): [`selectAll`](#commands.selectAll)
923923
/// - Backspace: [`deleteCharBackward`](#commands.deleteCharBackward)
924924
/// - Delete: [`deleteCharForward`](#commands.deleteCharForward)
@@ -952,7 +952,7 @@ export const standardKeymap: readonly KeyBinding[] = ([
952952
{key: "End", run: cursorLineBoundaryForward, shift: selectLineBoundaryForward, preventDefault: true},
953953
{key: "Mod-End", run: cursorDocEnd, shift: selectDocEnd},
954954

955-
{key: "Enter", run: insertNewlineAndIndent},
955+
{key: "Enter", run: insertNewlineAndIndent, shift: insertNewlineAndIndent},
956956

957957
{key: "Mod-a", run: selectAll},
958958

0 commit comments

Comments
 (0)