Merge branch 'main' into space-shell/helix-keybindings
This commit is contained in:
commit
0ef30d5e8d
31 changed files with 1750 additions and 345 deletions
|
|
@ -27,7 +27,7 @@ import { updateWidgets, widgetPlugin } from './widget.mjs';
|
|||
|
||||
export { toggleBlockComment, toggleBlockCommentByLine, toggleComment, toggleLineComment } from '@codemirror/commands';
|
||||
|
||||
const extensions = {
|
||||
export const extensions = {
|
||||
isLineWrappingEnabled: (on) => (on ? EditorView.lineWrapping : []),
|
||||
isBracketMatchingEnabled: (on) => (on ? bracketMatching({ brackets: '()[]{}<>' }) : []),
|
||||
isBracketClosingEnabled: (on) => (on ? closeBrackets() : []),
|
||||
|
|
@ -48,7 +48,7 @@ const extensions = {
|
|||
]
|
||||
: [],
|
||||
};
|
||||
const compartments = Object.fromEntries(Object.keys(extensions).map((key) => [key, new Compartment()]));
|
||||
export const compartments = Object.fromEntries(Object.keys(extensions).map((key) => [key, new Compartment()]));
|
||||
|
||||
export const defaultSettings = {
|
||||
keybindings: 'codemirror',
|
||||
|
|
@ -411,7 +411,7 @@ export class StrudelMirror {
|
|||
}
|
||||
}
|
||||
|
||||
function parseBooleans(value) {
|
||||
export function parseBooleans(value) {
|
||||
return { true: true, false: false }[value] ?? value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,3 +4,4 @@ export * from './flash.mjs';
|
|||
export * from './slider.mjs';
|
||||
export * from './themes.mjs';
|
||||
export * from './widget.mjs';
|
||||
export { Vim } from './keybindings.mjs';
|
||||
|
|
|
|||
|
|
@ -133,6 +133,8 @@ const keymaps = {
|
|||
vscode: vscodeExtension,
|
||||
};
|
||||
|
||||
export { Vim } from '@replit/codemirror-vim';
|
||||
|
||||
export function keybindings(name) {
|
||||
const active = keymaps[name];
|
||||
const extensions = active ? [Prec.high(active())] : [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue