diff options
author | Paulb23 <p_batty@hotmail.co.uk> | 2016-07-10 16:10:54 +0100 |
---|---|---|
committer | Paulb23 <p_batty@hotmail.co.uk> | 2016-07-10 16:10:54 +0100 |
commit | d43adcbb1e8e14935af21a2765b1c50f9a3d9f20 (patch) | |
tree | ad65a55fc6c0cb8269ed0204b25474e1efd5ef01 | |
parent | 637796900080cfcf407e1045f10e6e9040c8d33e (diff) | |
download | redot-engine-d43adcbb1e8e14935af21a2765b1c50f9a3d9f20.tar.gz |
Fixed highlight all occurrences highlighing highlighted section
-rw-r--r-- | scene/gui/text_edit.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 55e1a2cc52..1315b67ea1 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); } |