mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
Fix "Search" match inconsistencies
- Offset by searched length not line text - Continue searching line for whole word matches on mismatch: Breaking at this point makes it so that upon any whole word mismatch all potential matches after this point inline are skipped, to avoid this unwanted behavior we continue searching the line positioned after the mismatch.
This commit is contained in:
parent
33e65f2754
commit
5347c2b10e
1 changed files with 5 additions and 3 deletions
|
|
@ -377,10 +377,12 @@ void FindReplaceBar::_update_results_count() {
|
|||
|
||||
if (is_whole_words()) {
|
||||
if (col_pos > 0 && !is_symbol(line_text[col_pos - 1])) {
|
||||
break;
|
||||
col_pos += searched.length();
|
||||
continue;
|
||||
}
|
||||
if (col_pos + line_text.length() < line_text.length() && !is_symbol(line_text[col_pos + searched.length()])) {
|
||||
break;
|
||||
if (col_pos + searched.length() < line_text.length() && !is_symbol(line_text[col_pos + searched.length()])) {
|
||||
col_pos += searched.length();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue