| 524 | } |
| 525 | |
| 526 | bool FindReplaceBar::search_prev() { |
| 527 | if (is_selection_only() && !replace_all_mode) { |
| 528 | return false; |
| 529 | } |
| 530 | |
| 531 | if (!is_visible()) { |
| 532 | popup_search(true); |
| 533 | } |
| 534 | |
| 535 | String text = get_search_text(); |
| 536 | |
| 537 | if ((flags & TextEdit::SEARCH_BACKWARDS) == 0) { |
| 538 | needs_to_count_results = true; |
| 539 | } |
| 540 | |
| 541 | _update_flags(true); |
| 542 | |
| 543 | int line, col; |
| 544 | _get_search_from(line, col, SEARCH_PREV); |
| 545 | |
| 546 | col -= text.length(); |
| 547 | if (col < 0) { |
| 548 | line -= 1; |
| 549 | if (line < 0) { |
| 550 | line = text_editor->get_line_count() - 1; |
| 551 | } |
| 552 | col = text_editor->get_line(line).length(); |
| 553 | } |
| 554 | |
| 555 | return _search(flags, line, col); |
| 556 | } |
| 557 | |
| 558 | bool FindReplaceBar::search_next() { |
| 559 | if (is_selection_only() && !replace_all_mode) { |
no test coverage detected