Skip to content

Commit 332ee35

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

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)