From ae72d9ccd417fe7894369f6bfec962249c5fbf50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Sat, 10 Oct 2026 10:27:39 +0200 Subject: [PATCH] fix search --- client/components/codeEditor/codeEditor.jsx | 6 +++--- client/homebrew/editor/editor.jsx | 4 +++- client/homebrew/navbar/navbar.jsx | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/components/codeEditor/codeEditor.jsx b/client/components/codeEditor/codeEditor.jsx index 68c560f7b..f8ca6b15c 100644 --- a/client/components/codeEditor/codeEditor.jsx +++ b/client/components/codeEditor/codeEditor.jsx @@ -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 }; diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 27ed5465c..3c94c4101 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -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 (
@@ -384,6 +385,7 @@ const Editor = forwardRef( unfoldCode={unfoldCode} formatCode={isStyle() ? handleFormatCode : null} historySize={historySize()} + find={find} currentEditorTheme={editorSettings.editorTheme} updateEditorTheme={updateEditorTheme} themeBundle={themeBundle} diff --git a/client/homebrew/navbar/navbar.jsx b/client/homebrew/navbar/navbar.jsx index b1702f018..237fa1086 100644 --- a/client/homebrew/navbar/navbar.jsx +++ b/client/homebrew/navbar/navbar.jsx @@ -82,6 +82,7 @@ const Navbar = ({ children, brew, pageName, editor, title, currentPage, props }) }; const renderEdit = () => { + console.log(editor); return ( Edit} icon={null} key={'edit'}>