auto close brackets setting (#1110)

pull/1066/head
Fernando Serboncini 2024-10-08 15:06:33 -04:00 committed by GitHub
parent 899c2556cb
commit 7731b28203
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 1 deletions

View File

@ -43,6 +43,7 @@ export type Config = {
// Format: compatible with docker ignore
spaceIgnore?: string;
emoji?: EmojiConfig;
autoCloseBrackets: string;
schema: SchemaConfig;
@ -64,6 +65,7 @@ export const defaultConfig: Config = {
maximumAttachmentSize: 10, // MiB
defaultLinkStyle: "wikilink", // wikilink [[]] or markdown []()
actionButtons: [], // Actually defaults to defaultActionButtons
autoCloseBrackets: "([{`",
schema: {
config: {

View File

@ -100,7 +100,9 @@ export function createEditorState(
addKeymap: true,
}),
extendedMarkdownLanguage.data.of({
closeBrackets: { brackets: ["(", "{", "[", "`"] },
closeBrackets: {
brackets: client.config?.autoCloseBrackets.split(""),
},
}),
syntaxHighlighting(customMarkdownStyle()),
autocompletion({

View File

@ -58,6 +58,8 @@ shortcuts:
# Toggles between “smart” quotes (left and right) and "simple" 'quotes' (good ol' ASCII)
useSmartQuotes: true
# Choose which characters to auto-close
autoCloseBrackets: "([{`"
# Defines files to ignore in a format compatible with .gitignore
spaceIgnore: |