0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-03-30 05:28:11 +00:00

revert tab function to live behavior

This commit is contained in:
Víctor Losada Hernández
2026-03-29 00:49:08 +01:00
parent eb99af2735
commit 0fcf6dfe89
2 changed files with 8 additions and 2 deletions

View File

@@ -22,6 +22,11 @@ import { css, cssLanguage } from '@codemirror/lang-css';
import { markdown, markdownLanguage } from '@codemirror/lang-markdown'; import { markdown, markdownLanguage } from '@codemirror/lang-markdown';
import { autocompleteEmoji } from './autocompleteEmoji.js'; import { autocompleteEmoji } from './autocompleteEmoji.js';
import { searchKeymap, search } from '@codemirror/search'; import { searchKeymap, search } from '@codemirror/search';
import {closeBrackets} from "@codemirror/autocomplete"
const customClose = closeBrackets({
brackets: ["()", "[]", "{{}}"]
})
import * as themesImport from '@uiw/codemirror-themes-all'; import * as themesImport from '@uiw/codemirror-themes-all';
import defaultCM5Theme from '@themes/codeMirror/default.js'; import defaultCM5Theme from '@themes/codeMirror/default.js';
@@ -182,6 +187,7 @@ const CodeEditor = forwardRef(
customKeymap, customKeymap,
drawSelection(), drawSelection(),
EditorState.allowMultipleSelections.of(true), EditorState.allowMultipleSelections.of(true),
customClose,
]; ];
}; };

View File

@@ -209,8 +209,8 @@ const newPage = (view)=>{
export default keymap.of([ export default keymap.of([
{ key: 'Tab', run: insertTabAtCursor }, { key: 'Tab', run: insertTabAtCursor },
{ key: 'Shift-Tab', run: indentMore }, //{ key: 'Shift-Tab', run: indentMore },
{ key: 'Mod-Shift-Tab', run: indentLess }, { key: 'Shift-Tab', run: indentLess },
{ key: 'Mod-b', run: makeBold }, { key: 'Mod-b', run: makeBold },
{ key: 'Mod-i', run: makeItalic }, { key: 'Mod-i', run: makeItalic },
{ key: 'Mod-u', run: makeUnderline }, { key: 'Mod-u', run: makeUnderline },