Fix Codemirror undo history

This commit is contained in:
Gregory Schier
2024-10-09 12:00:52 -07:00
parent 2e2b3128c5
commit 2ca30bcb31
13 changed files with 1442 additions and 1457 deletions

View File

@@ -63,7 +63,7 @@
.template-tag {
/* Colors */
@apply bg-surface text-text-subtle border-border-subtle;
@apply bg-surface text-text-subtle border-border-subtle whitespace-nowrap;
@apply hover:border-border-subtle hover:text-text hover:bg-surface-highlight;
@apply inline border px-1 mx-[0.5px] rounded cursor-default dark:shadow;

View File

@@ -174,7 +174,7 @@ export const Editor = forwardRef<EditorView | undefined, EditorProps>(function E
id: 'template-function',
size: 'sm',
title: 'Configure Function',
description: fn.description || null,
description: fn.description,
render: ({ hide }) => (
<TemplateFunctionDialog
templateFunction={fn}

View File

@@ -4,7 +4,7 @@ import {
closeBracketsKeymap,
completionKeymap,
} from '@codemirror/autocomplete';
import { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands';
import { history, historyKeymap, indentWithTab } from '@codemirror/commands';
import { javascript } from '@codemirror/lang-javascript';
import { json } from '@codemirror/lang-json';
import { xml } from '@codemirror/lang-xml';
@@ -134,7 +134,7 @@ export const baseExtensions = [
}),
syntaxHighlighting(syntaxHighlightStyle),
syntaxTheme,
EditorState.allowMultipleSelections.of(true),
keymap.of([...historyKeymap, ...completionKeymap]),
];
export const multiLineExtensions = [
@@ -156,14 +156,5 @@ export const multiLineExtensions = [
rectangularSelection(),
crosshairCursor(),
highlightActiveLineGutter(),
keymap.of([
indentWithTab,
...closeBracketsKeymap,
...defaultKeymap,
...searchKeymap,
...historyKeymap,
...foldKeymap,
...completionKeymap,
...lintKeymap,
]),
keymap.of([indentWithTab, ...closeBracketsKeymap, ...searchKeymap, ...foldKeymap, ...lintKeymap]),
];