Fixes #149: vim mode

This commit is contained in:
Zef Hemel
2022-12-15 13:23:49 +01:00
parent d609daf59e
commit 0f090b77db
7 changed files with 40 additions and 10 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ export {
export type { NodeType, SyntaxNode, SyntaxNodeRef, Tree } from "@lezer/common";
export { searchKeymap } from "https://esm.sh/@codemirror/search@6.2.3?external=@codemirror/state,@codemirror/view";
export { searchKeymap } from "@codemirror/search";
export {
Decoration,
drawSelection,
+8 -3
View File
@@ -33,7 +33,12 @@ export function parseYamlSettings(settingsMarkdown: string): {
return {};
}
const yaml = match[1];
return YAML.parse(yaml) as {
[key: string]: any;
};
try {
return YAML.parse(yaml) as {
[key: string]: any;
};
} catch (e: any) {
console.error("Error parsing SETTINGS as YAML", e.message);
return {};
}
}