Skip to content

Commit c9633f2

Browse files
GiteaBotsilverwind
andauthored
Disable enter key for accepting code completion in Monaco (#30548) (#30559)
Backport #30548 by @silverwind Fixes #28114 and behaviour matches vscode on desktop as well. Co-authored-by: silverwind <me@silverwind.io>
1 parent d88958b commit c9633f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

web_src/js/features/codeeditor.js

+4
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ export async function createMonaco(textarea, filename, editorOpts) {
112112
...other,
113113
});
114114

115+
monaco.editor.addKeybindingRules([
116+
{keybinding: monaco.KeyCode.Enter, command: null}, // disable enter from accepting code completion
117+
]);
118+
115119
const model = editor.getModel();
116120
model.onDidChangeContent(() => {
117121
textarea.value = editor.getValue({preserveBOM: true});

0 commit comments

Comments
 (0)