mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-25 16:09:44 +00:00
Empty last selection on cancel
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
143c50f321
commit
acbda9184e
1 changed files with 5 additions and 1 deletions
|
@ -558,7 +558,11 @@ impl BufferView {
|
|||
self.update_selections(vec![pending_selection], true, ctx);
|
||||
}
|
||||
} else {
|
||||
let oldest_selection = selections.iter().min_by_key(|s| s.id).unwrap().clone();
|
||||
let mut oldest_selection = selections.iter().min_by_key(|s| s.id).unwrap().clone();
|
||||
if selections.len() == 1 {
|
||||
oldest_selection.start = oldest_selection.head().clone();
|
||||
oldest_selection.end = oldest_selection.head().clone();
|
||||
}
|
||||
self.update_selections(vec![oldest_selection], true, ctx);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue