Forgot to disable the find-replace component in UITextEdit.

This commit is contained in:
Martín Lucas Golini
2022-09-21 01:24:55 -03:00
parent fb68c91e49
commit cc0a403181
2 changed files with 16 additions and 0 deletions

View File

@@ -480,6 +480,10 @@ class EE_API UICodeEditor : public UIWidget, public TextDocument::Client {
Int64 getCurrentColumnCount() const;
bool getFindReplaceEnabled() const;
void setFindReplaceEnabled( bool findReplaceEnabled );
protected:
struct LastXOffset {
TextPosition position;
@@ -513,6 +517,7 @@ class EE_API UICodeEditor : public UIWidget, public TextDocument::Client {
bool mMinimapDragging{ false };
bool mMinimapHover{ false };
bool mAutoCloseXMLTags{ false };
bool mFindReplaceEnabled{ true };
TextRange mLinkPosition;
String mLink;
Uint32 mTabWidth;

View File

@@ -523,6 +523,7 @@ void UICodeEditor::disableEditorFeatures() {
mHighlightSelectionMatch = false;
mEnableColorPickerOnSelection = false;
mMinimapEnabled = false;
mFindReplaceEnabled = false;
mLineBreakingColumn = 0;
}
@@ -2609,6 +2610,8 @@ void UICodeEditor::registerCommands() {
}
void UICodeEditor::findReplace() {
if ( !mFindReplaceEnabled )
return;
if ( nullptr == mFindReplace )
mFindReplace = UIDocFindReplace::New( this, mDoc );
mFindReplace->show();
@@ -3104,6 +3107,14 @@ Int64 UICodeEditor::getCurrentColumnCount() const {
return count;
}
bool UICodeEditor::getFindReplaceEnabled() const {
return mFindReplaceEnabled;
}
void UICodeEditor::setFindReplaceEnabled( bool findReplaceEnabled ) {
mFindReplaceEnabled = findReplaceEnabled;
}
Text& UICodeEditor::getLineText( const Int64& lineNumber ) const {
auto it = mTextCache.find( lineNumber );
if ( it == mTextCache.end() || it->second.hash != mDoc->line( lineNumber ).getHash() ) {