| 728 | } |
| 729 | |
| 730 | void FindReplaceBar::set_text_edit(CodeTextEditor *p_text_editor) { |
| 731 | if (p_text_editor == base_text_editor) { |
| 732 | return; |
| 733 | } |
| 734 | |
| 735 | if (base_text_editor) { |
| 736 | text_editor->set_search_text(String()); |
| 737 | base_text_editor->remove_find_replace_bar(); |
| 738 | base_text_editor = nullptr; |
| 739 | text_editor->disconnect(SceneStringName(text_changed), callable_mp(this, &FindReplaceBar::_editor_text_changed)); |
| 740 | text_editor = nullptr; |
| 741 | } |
| 742 | |
| 743 | if (!p_text_editor) { |
| 744 | return; |
| 745 | } |
| 746 | |
| 747 | results_count = -1; |
| 748 | results_count_to_current = -1; |
| 749 | needs_to_count_results = true; |
| 750 | base_text_editor = p_text_editor; |
| 751 | text_editor = base_text_editor->get_text_editor(); |
| 752 | text_editor->connect(SceneStringName(text_changed), callable_mp(this, &FindReplaceBar::_editor_text_changed)); |
| 753 | |
| 754 | _editor_text_changed(); |
| 755 | } |
| 756 | |
| 757 | void FindReplaceBar::_bind_methods() { |
| 758 | ClassDB::bind_method("_search_current", &FindReplaceBar::search_current); |
no test coverage detected