You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Remove secondary carets when using FindReplaceBar
This commit is contained in:
@@ -143,6 +143,7 @@ void FindReplaceBar::unhandled_input(const Ref<InputEvent> &p_event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool FindReplaceBar::_search(uint32_t p_flags, int p_from_line, int p_from_col) {
|
bool FindReplaceBar::_search(uint32_t p_flags, int p_from_line, int p_from_col) {
|
||||||
|
text_editor->remove_secondary_carets();
|
||||||
String text = get_search_text();
|
String text = get_search_text();
|
||||||
Point2i pos = text_editor->search(text, p_flags, p_from_line, p_from_col);
|
Point2i pos = text_editor->search(text, p_flags, p_from_line, p_from_col);
|
||||||
|
|
||||||
@@ -178,6 +179,7 @@ bool FindReplaceBar::_search(uint32_t p_flags, int p_from_line, int p_from_col)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FindReplaceBar::_replace() {
|
void FindReplaceBar::_replace() {
|
||||||
|
text_editor->remove_secondary_carets();
|
||||||
bool selection_enabled = text_editor->has_selection(0);
|
bool selection_enabled = text_editor->has_selection(0);
|
||||||
Point2i selection_begin, selection_end;
|
Point2i selection_begin, selection_end;
|
||||||
if (selection_enabled) {
|
if (selection_enabled) {
|
||||||
@@ -225,6 +227,7 @@ void FindReplaceBar::_replace() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FindReplaceBar::_replace_all() {
|
void FindReplaceBar::_replace_all() {
|
||||||
|
text_editor->remove_secondary_carets();
|
||||||
text_editor->disconnect("text_changed", callable_mp(this, &FindReplaceBar::_editor_text_changed));
|
text_editor->disconnect("text_changed", callable_mp(this, &FindReplaceBar::_editor_text_changed));
|
||||||
// Line as x so it gets priority in comparison, column as y.
|
// Line as x so it gets priority in comparison, column as y.
|
||||||
Point2i orig_cursor(text_editor->get_caret_line(0), text_editor->get_caret_column(0));
|
Point2i orig_cursor(text_editor->get_caret_line(0), text_editor->get_caret_column(0));
|
||||||
|
|||||||
Reference in New Issue
Block a user