mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-16 07:58:44 +00:00
fix search
This commit is contained in:
@@ -30,7 +30,7 @@ import { css } from '@codemirror/lang-css';
|
|||||||
import { markdown, markdownLanguage } from '@codemirror/lang-markdown';
|
import { markdown, markdownLanguage } from '@codemirror/lang-markdown';
|
||||||
import { html } from '@codemirror/lang-html';
|
import { html } from '@codemirror/lang-html';
|
||||||
import { autocompleteEmoji } from './extensions/autocompleteEmoji.js';
|
import { autocompleteEmoji } from './extensions/autocompleteEmoji.js';
|
||||||
import { searchKeymap, search } from '@codemirror/search';
|
import { searchKeymap, search, openSearchPanel } from '@codemirror/search';
|
||||||
import { closeBrackets } from '@codemirror/autocomplete';
|
import { closeBrackets } from '@codemirror/autocomplete';
|
||||||
|
|
||||||
const autoCloseBrackets = closeBrackets({ brackets: ['()', '[]', '{{}}'] });
|
const autoCloseBrackets = closeBrackets({ brackets: ['()', '[]', '{{}}'] });
|
||||||
@@ -395,7 +395,7 @@ const CodeEditor = forwardRef(
|
|||||||
undo : ()=>undo(viewRef.current),
|
undo : ()=>undo(viewRef.current),
|
||||||
redo : ()=>redo(viewRef.current),
|
redo : ()=>redo(viewRef.current),
|
||||||
|
|
||||||
find: () => openSearchPanel(viewRef.current),
|
find: () =>openSearchPanel(viewRef.current),
|
||||||
|
|
||||||
historySize : ()=>{
|
historySize : ()=>{
|
||||||
const view = viewRef.current;
|
const view = viewRef.current;
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ const Editor = forwardRef(
|
|||||||
const undo = ()=>codeEditor.current?.undo();
|
const undo = ()=>codeEditor.current?.undo();
|
||||||
const foldCode = ()=>codeEditor.current?.foldAll();
|
const foldCode = ()=>codeEditor.current?.foldAll();
|
||||||
const unfoldCode = ()=>codeEditor.current?.unfoldAll();
|
const unfoldCode = ()=>codeEditor.current?.unfoldAll();
|
||||||
|
const find = ()=>codeEditor.current?.find();
|
||||||
//Called when there are changes to the editor's dimensions
|
//Called when there are changes to the editor's dimensions
|
||||||
const update = ()=>{};
|
const update = ()=>{};
|
||||||
|
|
||||||
@@ -367,6 +367,7 @@ const Editor = forwardRef(
|
|||||||
foldCode,
|
foldCode,
|
||||||
unfoldCode,
|
unfoldCode,
|
||||||
historySize,
|
historySize,
|
||||||
|
find,
|
||||||
}));
|
}));
|
||||||
return (
|
return (
|
||||||
<div className={`editor${isDark ? ' darkMode' : ''}`} ref={editor}>
|
<div className={`editor${isDark ? ' darkMode' : ''}`} ref={editor}>
|
||||||
@@ -384,6 +385,7 @@ const Editor = forwardRef(
|
|||||||
unfoldCode={unfoldCode}
|
unfoldCode={unfoldCode}
|
||||||
formatCode={isStyle() ? handleFormatCode : null}
|
formatCode={isStyle() ? handleFormatCode : null}
|
||||||
historySize={historySize()}
|
historySize={historySize()}
|
||||||
|
find={find}
|
||||||
currentEditorTheme={editorSettings.editorTheme}
|
currentEditorTheme={editorSettings.editorTheme}
|
||||||
updateEditorTheme={updateEditorTheme}
|
updateEditorTheme={updateEditorTheme}
|
||||||
themeBundle={themeBundle}
|
themeBundle={themeBundle}
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ const Navbar = ({ children, brew, pageName, editor, title, currentPage, props })
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderEdit = () => {
|
const renderEdit = () => {
|
||||||
|
console.log(editor);
|
||||||
return (
|
return (
|
||||||
<Dropdown groupName={'Edit'} customTrigger={<>Edit</>} icon={null} key={'edit'}>
|
<Dropdown groupName={'Edit'} customTrigger={<>Edit</>} icon={null} key={'edit'}>
|
||||||
<div className='nav-section'>
|
<div className='nav-section'>
|
||||||
|
|||||||
Reference in New Issue
Block a user