Unfold range when selecting the next match
Selected matches are unfolded when in project search, buffer search and when hitting `cmd-d` to select the next match.
This commit is contained in:
@@ -3907,6 +3907,7 @@ impl Editor {
|
|||||||
reversed: false,
|
reversed: false,
|
||||||
goal: SelectionGoal::None,
|
goal: SelectionGoal::None,
|
||||||
});
|
});
|
||||||
|
self.unfold_ranges([next_selected_range], false, cx);
|
||||||
self.update_selections(selections, Some(Autoscroll::Newest), cx);
|
self.update_selections(selections, Some(Autoscroll::Newest), cx);
|
||||||
} else {
|
} else {
|
||||||
select_next_state.done = true;
|
select_next_state.done = true;
|
||||||
@@ -3934,6 +3935,7 @@ impl Editor {
|
|||||||
wordwise: true,
|
wordwise: true,
|
||||||
done: false,
|
done: false,
|
||||||
};
|
};
|
||||||
|
self.unfold_ranges([selection.start..selection.end], false, cx);
|
||||||
self.update_selections(selections, Some(Autoscroll::Newest), cx);
|
self.update_selections(selections, Some(Autoscroll::Newest), cx);
|
||||||
self.select_next_state = Some(select_state);
|
self.select_next_state = Some(select_state);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -336,11 +336,9 @@ impl SearchBar {
|
|||||||
direction,
|
direction,
|
||||||
&editor.buffer().read(cx).read(cx),
|
&editor.buffer().read(cx).read(cx),
|
||||||
);
|
);
|
||||||
editor.select_ranges(
|
let range_to_select = ranges[new_index].clone();
|
||||||
[ranges[new_index].clone()],
|
editor.unfold_ranges([range_to_select.clone()], false, cx);
|
||||||
Some(Autoscroll::Fit),
|
editor.select_ranges([range_to_select], Some(Autoscroll::Fit), cx);
|
||||||
cx,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -489,6 +489,7 @@ impl ProjectSearchView {
|
|||||||
);
|
);
|
||||||
let range_to_select = model.match_ranges[new_index].clone();
|
let range_to_select = model.match_ranges[new_index].clone();
|
||||||
self.results_editor.update(cx, |editor, cx| {
|
self.results_editor.update(cx, |editor, cx| {
|
||||||
|
editor.unfold_ranges([range_to_select.clone()], false, cx);
|
||||||
editor.select_ranges([range_to_select], Some(Autoscroll::Fit), cx);
|
editor.select_ranges([range_to_select], Some(Autoscroll::Fit), cx);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user