Procházet zdrojové kódy

Merge pull request #7330 from darkfoxprime/#7326-fix-whole-word-search

Fix search to find "whole" words at end of line
Rémi Verschelde před 8 roky
rodič
revize
2b847d2a2e
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      scene/gui/text_edit.cpp

+ 1 - 1
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])) {
 				if (col > 0 && _is_text_char(p_search[col-1])) {
 					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;
 					col = -1;
 				}
 				}
 			}
 			}