text search

This commit is contained in:
2026-02-28 11:01:42 +10:00
parent f5581135db
commit 7b22aaa426
4 changed files with 128 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import { EditorState, StateField, StateEffect, Annotation, RangeSetBuilder, Comp
import { markdown } from '@codemirror/lang-markdown'
import { syntaxHighlighting, defaultHighlightStyle } from '@codemirror/language'
import { history, defaultKeymap, historyKeymap, invertedEffects, selectAll, indentLess } from '@codemirror/commands'
import { search, searchKeymap } from '@codemirror/search'
import { marked } from 'marked'
import DOMPurify from 'dompurify'
import { useEditorStore } from '../../store/editorStore'
@@ -375,6 +376,7 @@ export function MarkdownEditor(): JSX.Element {
doc: '',
extensions: [
history(),
search({ top: true }),
keymap.of([
{
key: 'Tab',
@@ -384,6 +386,7 @@ export function MarkdownEditor(): JSX.Element {
}
},
{ key: 'Shift-Tab', run: indentLess },
...searchKeymap,
...defaultKeymap,
...historyKeymap
]),