aboutsummaryrefslogtreecommitdiff
path: root/scene/gui/text_edit.cpp
diff options
context:
space:
mode:
authorRémi Verschelde2016-07-10 19:42:56 +0200
committerGitHub2016-07-10 19:42:56 +0200
commitd37ef5990b229c0fb90c25e884ae6ef42dda5a6c (patch)
tree7e450b6d6f84763230ae802ad1f690b7faf7d935 /scene/gui/text_edit.cpp
parent83ab4445f2b37401593855e40c1628e5742babb1 (diff)
parentd43adcbb1e8e14935af21a2765b1c50f9a3d9f20 (diff)
downloadgodot-d37ef5990b229c0fb90c25e884ae6ef42dda5a6c.tar.gz
godot-d37ef5990b229c0fb90c25e884ae6ef42dda5a6c.tar.zst
godot-d37ef5990b229c0fb90c25e884ae6ef42dda5a6c.zip
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r--scene/gui/text_edit.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 55e1a2cc5..1315b67ea 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -965,6 +965,12 @@ void TextEdit::_notification(int p_what) {
}
bool in_highlighted_word = (j >= highlighted_text_col && j < highlighted_text_col+highlighted_text.length());
+
+ /* if this is the original highlighted text we don't want to highlight it again */
+ if (cursor.line==line && (cursor.column >= highlighted_text_col && cursor.column <= highlighted_text_col+highlighted_text.length())) {
+ in_highlighted_word = false;
+ }
+
if (in_highlighted_word) {
VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(Point2i( char_ofs+char_margin, ofs_y ), Size2i(char_w, get_row_height())),cache.word_highlighted_color);
}