aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands/on_enter.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/commands/on_enter.ts')
-rw-r--r--editors/code/src/commands/on_enter.ts10
1 files changed, 1 insertions, 9 deletions
diff --git a/editors/code/src/commands/on_enter.ts b/editors/code/src/commands/on_enter.ts
index 1b3d3d741..ac582b423 100644
--- a/editors/code/src/commands/on_enter.ts
+++ b/editors/code/src/commands/on_enter.ts
@@ -26,17 +26,9 @@ async function handleKeypress(ctx: Ctx) {
26 return true; 26 return true;
27} 27}
28 28
29export function onEnterOverride(ctx: Ctx): Cmd {
30 return async (event: { text: string }) => {
31 if (event.text === '\n') {
32 handleKeypress(ctx);
33 }
34 };
35}
36
37export function onEnter(ctx: Ctx): Cmd { 29export function onEnter(ctx: Ctx): Cmd {
38 return async () => { 30 return async () => {
39 if (handleKeypress(ctx)) return; 31 if (await handleKeypress(ctx)) return;
40 32
41 await vscode.commands.executeCommand('default:type', { text: '\n' }); 33 await vscode.commands.executeCommand('default:type', { text: '\n' });
42 }; 34 };