| 210 | } |
| 211 | |
| 212 | bool FindReplaceBar::_search(uint32_t p_flags, int p_from_line, int p_from_col) { |
| 213 | if (!preserve_cursor) { |
| 214 | text_editor->remove_secondary_carets(); |
| 215 | } |
| 216 | String text = get_search_text(); |
| 217 | Point2i pos = text_editor->search(text, p_flags, p_from_line, p_from_col); |
| 218 | |
| 219 | if (pos.x != -1) { |
| 220 | if (!preserve_cursor && !is_selection_only()) { |
| 221 | text_editor->unfold_line(pos.y); |
| 222 | text_editor->select(pos.y, pos.x, pos.y, pos.x + text.length()); |
| 223 | text_editor->center_viewport_to_caret(0); |
| 224 | text_editor->set_code_hint(""); |
| 225 | text_editor->cancel_code_completion(); |
| 226 | |
| 227 | line_col_changed_for_result = true; |
| 228 | } |
| 229 | |
| 230 | text_editor->set_search_text(text); |
| 231 | text_editor->set_search_flags(p_flags); |
| 232 | |
| 233 | result_line = pos.y; |
| 234 | result_col = pos.x; |
| 235 | |
| 236 | _update_results_count(); |
| 237 | } else { |
| 238 | results_count = 0; |
| 239 | result_line = -1; |
| 240 | result_col = -1; |
| 241 | text_editor->set_search_text(""); |
| 242 | text_editor->set_search_flags(p_flags); |
| 243 | } |
| 244 | |
| 245 | _update_matches_display(); |
| 246 | |
| 247 | return pos.x != -1; |
| 248 | } |
| 249 | |
| 250 | void FindReplaceBar::_replace() { |
| 251 | text_editor->begin_complex_operation(); |
nothing calls this directly
no test coverage detected