fix: ctrl+enter inserting newline in code (#4108)
* fix: ctrl+enter inserting newline in code * chore: add 'cmd+enter' to the key list --------- Co-authored-by: nivedin <nivedinp@gmail.com>
This commit is contained in:
parent
fe79c47d1f
commit
71ac013a38
1 changed files with 10 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ import {
|
|||
EditorState,
|
||||
Compartment,
|
||||
EditorSelection,
|
||||
Prec,
|
||||
} from "@codemirror/state"
|
||||
import {
|
||||
Language,
|
||||
|
|
@ -367,6 +368,15 @@ export function useCodemirror(
|
|||
run: indentLess,
|
||||
},
|
||||
]),
|
||||
Prec.highest(
|
||||
keymap.of([
|
||||
{
|
||||
key: "Cmd-Enter" /* macOS */ || "Ctrl-Enter" /* Windows */,
|
||||
preventDefault: true,
|
||||
run: () => true,
|
||||
},
|
||||
])
|
||||
),
|
||||
tooltips({
|
||||
parent: document.body,
|
||||
position: "absolute",
|
||||
|
|
|
|||
Loading…
Reference in a new issue