Fix Enter for vim mode (#1146)
This is a workaround for https://github.com/replit/codemirror-vim/issues/182 Fixes https://github.com/silverbulletmd/silverbullet/pull/1145 (harder)pull/1150/head
parent
4457927416
commit
916c84e9c1
|
@ -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,
|
||||
]);
|
||||
|
|
Loading…
Reference in New Issue