diff --git a/src/tools/ecode/docsearchcontroller.cpp b/src/tools/ecode/docsearchcontroller.cpp index d0da6120c..cef4e4fa6 100644 --- a/src/tools/ecode/docsearchcontroller.cpp +++ b/src/tools/ecode/docsearchcontroller.cpp @@ -357,9 +357,14 @@ void DocSearchController::hideSearchBar() { void DocSearchController::onCodeEditorFocusChange( UICodeEditor* editor ) { if ( mSearchState.editor && mSearchState.editor != editor ) { - auto word = mSearchState.editor->getHighlightWord(); - mSearchState.editor->setHighlightWord( { "" } ); - mSearchState.editor->setHighlightTextRange( TextRange() ); + TextSearchParams word; + if ( mEditorSplitter->editorExists( mSearchState.editor ) ) { + word = mSearchState.editor->getHighlightWord(); + mSearchState.editor->setHighlightWord( { "" } ); + mSearchState.editor->setHighlightTextRange( TextRange() ); + } else { + mSearchState.editor = nullptr; + } mSearchState.text = ""; mSearchState.range = TextRange(); if ( editor ) { diff --git a/src/tools/ecode/plugins/formatter/formatterplugin.cpp b/src/tools/ecode/plugins/formatter/formatterplugin.cpp index ad07beb27..bab9f1956 100644 --- a/src/tools/ecode/plugins/formatter/formatterplugin.cpp +++ b/src/tools/ecode/plugins/formatter/formatterplugin.cpp @@ -275,6 +275,7 @@ bool FormatterPlugin::onCreateContextMenu( UICodeEditor* editor, UIPopUpMenu* me !supportsLSPFormatter( editor->getDocumentRef() ) ) return false; + menu->addSeparator(); menu->add( editor->getUISceneNode()->i18n( "formatter-format-document", "Format Document" ), nullptr, KeyBindings::keybindFormat( mKeyBindings["format-doc"] ) ) ->setId( "format-doc" );