mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-24 19:10:24 +00:00
End pending selection when starting a transaction
Co-Authored-By: Max Brunsfeld <max@zed.dev> Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
c07d794249
commit
941d935c4a
1 changed files with 6 additions and 3 deletions
|
@ -670,8 +670,10 @@ impl Editor {
|
|||
}
|
||||
|
||||
fn end_selection(&mut self, cx: &mut ViewContext<Self>) {
|
||||
let selections = self.selections::<Point>(cx).collect::<Vec<_>>();
|
||||
self.update_selections(selections, false, cx);
|
||||
if self.pending_selection.is_some() {
|
||||
let selections = self.selections::<usize>(cx).collect::<Vec<_>>();
|
||||
self.update_selections(selections, false, cx);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_selecting(&self) -> bool {
|
||||
|
@ -2404,7 +2406,8 @@ impl Editor {
|
|||
cx.notify();
|
||||
}
|
||||
|
||||
fn start_transaction(&self, cx: &mut ViewContext<Self>) {
|
||||
fn start_transaction(&mut self, cx: &mut ViewContext<Self>) {
|
||||
self.end_selection(cx);
|
||||
self.buffer.update(cx, |buffer, _| {
|
||||
buffer
|
||||
.start_transaction(Some(self.selection_set_id))
|
||||
|
|
Loading…
Reference in a new issue