MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / search_prev

Method search_prev

editor/gui/code_editor.cpp:526–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524}
525
526bool 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
558bool FindReplaceBar::search_next() {
559 if (is_selection_only() && !replace_all_mode) {

Callers 4

_edit_optionMethod · 0.45
_edit_optionMethod · 0.45
_menu_optionMethod · 0.45
inputMethod · 0.45

Calls 3

lengthMethod · 0.45
get_line_countMethod · 0.45
get_lineMethod · 0.45

Tested by

no test coverage detected