Honor setting the selected range in addition to marking text

This commit is contained in:
Antonio Scandurra 2022-07-21 08:57:20 +02:00
parent f712dec4c0
commit eda60effed
3 changed files with 10 additions and 4 deletions

View file

@ -5922,7 +5922,7 @@ impl View for Editor {
&mut self,
range: Option<Range<usize>>,
text: &str,
_new_selected_range: Option<Range<usize>>,
new_selected_range: Option<Range<usize>>,
cx: &mut ViewContext<Self>,
) {
self.transact(cx, |this, cx| {
@ -5948,6 +5948,10 @@ impl View for Editor {
);
this.handle_input(text, cx);
if let Some(new_selected_range) = new_selected_range {
this.set_selected_text_range(new_selected_range, cx);
}
});
}
}