fix search

This commit is contained in:
Víctor Losada Hernández
2026-10-10 10:27:39 +02:00
parent 58dedde541
commit ae72d9ccd4
3 changed files with 7 additions and 4 deletions
+3 -3
View File
@@ -30,7 +30,7 @@ import { css } from '@codemirror/lang-css';
import { markdown, markdownLanguage } from '@codemirror/lang-markdown';
import { html } from '@codemirror/lang-html';
import { autocompleteEmoji } from './extensions/autocompleteEmoji.js';
import { searchKeymap, search } from '@codemirror/search';
import { searchKeymap, search, openSearchPanel } from '@codemirror/search';
import { closeBrackets } from '@codemirror/autocomplete';
const autoCloseBrackets = closeBrackets({ brackets: ['()', '[]', '{{}}'] });
@@ -395,8 +395,8 @@ const CodeEditor = forwardRef(
undo : ()=>undo(viewRef.current),
redo : ()=>redo(viewRef.current),
find: () => openSearchPanel(viewRef.current),
find: () =>openSearchPanel(viewRef.current),
historySize : ()=>{
const view = viewRef.current;
if(!view) return { done: 0, undone: 0 };
+3 -1
View File
@@ -356,7 +356,7 @@ const Editor = forwardRef(
const undo = ()=>codeEditor.current?.undo();
const foldCode = ()=>codeEditor.current?.foldAll();
const unfoldCode = ()=>codeEditor.current?.unfoldAll();
const find = ()=>codeEditor.current?.find();
//Called when there are changes to the editor's dimensions
const update = ()=>{};
@@ -367,6 +367,7 @@ const Editor = forwardRef(
foldCode,
unfoldCode,
historySize,
find,
}));
return (
<div className={`editor${isDark ? ' darkMode' : ''}`} ref={editor}>
@@ -384,6 +385,7 @@ const Editor = forwardRef(
unfoldCode={unfoldCode}
formatCode={isStyle() ? handleFormatCode : null}
historySize={historySize()}
find={find}
currentEditorTheme={editorSettings.editorTheme}
updateEditorTheme={updateEditorTheme}
themeBundle={themeBundle}
+1
View File
@@ -82,6 +82,7 @@ const Navbar = ({ children, brew, pageName, editor, title, currentPage, props })
};
const renderEdit = () => {
console.log(editor);
return (
<Dropdown groupName={'Edit'} customTrigger={<>Edit</>} icon={null} key={'edit'}>
<div className='nav-section'>