Ohad Lutzky 2024-11-11 12:57:19 +00:00 committed by GitHub
parent 4457927416
commit 916c84e9c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import customMarkdownStyle from "./style.ts";
import {
history,
indentWithTab,
insertNewlineAndIndent,
isolateHistory,
standardKeymap,
} from "@codemirror/commands";
@ -367,7 +368,18 @@ export function createKeyBindings(client: Client): Extension {
...createCommandKeyBindings(client),
...createSmartQuoteKeyBindings(client),
...closeBracketsKeymap,
...client.ui.viewState.uiOptions.vimMode ? [] : standardKeymap,
...client.ui.viewState.uiOptions.vimMode
? [
// Workaround for https://github.com/replit/codemirror-vim/issues/182;
// without this, Enter does nothing for ordinary paragraphs in insert
// mode.
{
key: "Enter",
run: insertNewlineAndIndent,
shift: insertNewlineAndIndent,
},
]
: standardKeymap,
...completionKeymap,
indentWithTab,
]);