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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user