diff options
author | Johnson Earls <darkfoxprime@gmail.com> | 2016-12-18 06:19:22 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-18 06:19:22 -0800 |
commit | d1cf29fe9936b8a433601efa891453dcbb702227 (patch) | |
tree | 8d3e56893d01cbe05719aabd4584a363015eba71 /scene/gui | |
parent | afbe013ba12d68f20ef1dfe2d7a895105a440bd9 (diff) |
Fix search to find "whole" words at end of line
Fix `_get_column_pos_of_word` so that the `SEARCH_WHOLE_WORDS` flag will properly find words that are at the end of a line.
Fixes #7326 .
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/text_edit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index c585fff2a6..46d4144a85 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -3783,7 +3783,7 @@ int TextEdit::_get_column_pos_of_word(const String &p_key, const String &p_searc if (col > 0 && _is_text_char(p_search[col-1])) { col = -1; - } else if (_is_text_char(p_search[col+p_key.length()])) { + } else if ((col + p_key.length()) < p_search.length() && _is_text_char(p_search[col+p_key.length()])) { col = -1; } } |