aboutsummaryrefslogtreecommitdiff
path: root/scene/gui/text_edit.cpp
diff options
context:
space:
mode:
authorJohnson Earls2016-12-18 06:19:22 -0800
committerRémi Verschelde2017-01-12 19:15:27 +0100
commitf08aa026889055356b032091ed0760ee830c94bf (patch)
tree0e0f560898d1c6598ea8755e9d18e1702ff4162d /scene/gui/text_edit.cpp
parenta8bc2f64ad5f988570839843f7308e1768e28b0b (diff)
downloadgodot-f08aa026889055356b032091ed0760ee830c94bf.tar.gz
godot-f08aa026889055356b032091ed0760ee830c94bf.tar.zst
godot-f08aa026889055356b032091ed0760ee830c94bf.zip
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 . (cherry picked from commit d1cf29fe9936b8a433601efa891453dcbb702227)
Diffstat (limited to '')
-rw-r--r--scene/gui/text_edit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 93a6daf4f..54f142366 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -3690,7 +3690,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;
}
}