mirror of https://github.com/laurent22/joplin.git
Mobile: Ctrl+F search support in beta editor (#6587)
parent
20a7cd2323
commit
aaa610d5f4
|
@ -11,6 +11,7 @@
|
|||
|
||||
import { EditorState, Extension } from '@codemirror/state';
|
||||
import { markdown } from '@codemirror/lang-markdown';
|
||||
import { highlightSelectionMatches, search } from '@codemirror/search';
|
||||
import { defaultHighlightStyle, syntaxHighlighting, HighlightStyle } from '@codemirror/language';
|
||||
import { tags } from '@lezer/highlight';
|
||||
import { EditorView, drawSelection, highlightSpecialChars, ViewUpdate } from '@codemirror/view';
|
||||
|
@ -18,6 +19,7 @@ import { undo, redo, history, undoDepth, redoDepth } from '@codemirror/commands'
|
|||
|
||||
import { keymap } from '@codemirror/view';
|
||||
import { indentOnInput } from '@codemirror/language';
|
||||
import { searchKeymap } from '@codemirror/search';
|
||||
import { historyKeymap, defaultKeymap } from '@codemirror/commands';
|
||||
|
||||
interface CodeMirrorResult {
|
||||
|
@ -183,8 +185,10 @@ export function initCodeMirror(parentElement: any, initialText: string, theme: a
|
|||
markdown(),
|
||||
...createTheme(theme),
|
||||
history(),
|
||||
search(),
|
||||
drawSelection(),
|
||||
highlightSpecialChars(),
|
||||
highlightSelectionMatches(),
|
||||
indentOnInput(),
|
||||
|
||||
EditorView.lineWrapping,
|
||||
|
@ -203,7 +207,7 @@ export function initCodeMirror(parentElement: any, initialText: string, theme: a
|
|||
}
|
||||
}),
|
||||
keymap.of([
|
||||
...defaultKeymap, ...historyKeymap,
|
||||
...defaultKeymap, ...historyKeymap, ...searchKeymap,
|
||||
]),
|
||||
],
|
||||
doc: initialText,
|
||||
|
|
|
@ -73,6 +73,7 @@
|
|||
"@codemirror/commands": "^6.0.0",
|
||||
"@codemirror/lang-markdown": "^6.0.0",
|
||||
"@codemirror/language": "^6.0.0",
|
||||
"@codemirror/search": "^6.0.0",
|
||||
"@codemirror/state": "^6.0.0",
|
||||
"@codemirror/view": "^6.0.0",
|
||||
"@joplin/tools": "~2.8",
|
||||
|
|
12
yarn.lock
12
yarn.lock
|
@ -2189,6 +2189,17 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@codemirror/search@npm:^6.0.0":
|
||||
version: 6.0.0
|
||||
resolution: "@codemirror/search@npm:6.0.0"
|
||||
dependencies:
|
||||
"@codemirror/state": ^6.0.0
|
||||
"@codemirror/view": ^6.0.0
|
||||
crelt: ^1.0.5
|
||||
checksum: e40b55f1ff1287a8b5b321f633bff638c9d4a411ada524b36b275344a13f9f4a66b7c5176d8a142a6a7761d1591d18dc535c88897f30b9885508a2890162fc72
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@codemirror/state@npm:^6.0.0":
|
||||
version: 6.0.0
|
||||
resolution: "@codemirror/state@npm:6.0.0"
|
||||
|
@ -3261,6 +3272,7 @@ __metadata:
|
|||
"@codemirror/commands": ^6.0.0
|
||||
"@codemirror/lang-markdown": ^6.0.0
|
||||
"@codemirror/language": ^6.0.0
|
||||
"@codemirror/search": ^6.0.0
|
||||
"@codemirror/state": ^6.0.0
|
||||
"@codemirror/view": ^6.0.0
|
||||
"@joplin/lib": ~2.8
|
||||
|
|
Loading…
Reference in New Issue