💄 native menu items
This commit is contained in:
@@ -4,7 +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 { search, searchKeymap, openSearchPanel } from '@codemirror/search'
|
||||
import { marked } from 'marked'
|
||||
import DOMPurify from 'dompurify'
|
||||
import { useEditorStore } from '../../store/editorStore'
|
||||
@@ -632,6 +632,14 @@ export function MarkdownEditor(): JSX.Element {
|
||||
view.dispatch({ effects: themeCompartment.reconfigure(buildTheme(fontSize, theme === 'dark')) })
|
||||
}, [fontSize, theme])
|
||||
|
||||
useEffect(() => {
|
||||
return window.api.onMenuAction((action) => {
|
||||
if (action === 'find' && viewRef.current) {
|
||||
openSearchPanel(viewRef.current)
|
||||
}
|
||||
})
|
||||
}, [])
|
||||
|
||||
function handleContextMenu(e: React.MouseEvent): void {
|
||||
if (!activeFilePath) return
|
||||
e.preventDefault()
|
||||
|
||||
Reference in New Issue
Block a user