mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-07 02:57:34 +00:00
Clear selections on buffer only if they hadn't been cleared already
This commit is contained in:
parent
b4561b848d
commit
a435dc1339
1 changed files with 7 additions and 1 deletions
|
@ -1353,8 +1353,14 @@ impl Buffer {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn remove_active_selections(&mut self, cx: &mut ModelContext<Self>) {
|
pub fn remove_active_selections(&mut self, cx: &mut ModelContext<Self>) {
|
||||||
|
if self
|
||||||
|
.remote_selections
|
||||||
|
.get(&self.text.replica_id())
|
||||||
|
.map_or(true, |set| !set.selections.is_empty())
|
||||||
|
{
|
||||||
self.set_active_selections(Arc::from([]), false, Default::default(), cx);
|
self.set_active_selections(Arc::from([]), false, Default::default(), cx);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn set_text<T>(&mut self, text: T, cx: &mut ModelContext<Self>) -> Option<clock::Local>
|
pub fn set_text<T>(&mut self, text: T, cx: &mut ModelContext<Self>) -> Option<clock::Local>
|
||||||
where
|
where
|
||||||
|
|
Loading…
Reference in a new issue