Avoid grouping transactions created by different editors
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
co-authored by
Nathan Sobo
parent
adf00fafdf
commit
f055053fc9
@@ -3952,6 +3952,7 @@ impl View for Editor {
|
||||
self.focused = true;
|
||||
self.blink_cursors(self.blink_epoch, cx);
|
||||
self.buffer.update(cx, |buffer, cx| {
|
||||
buffer.avoid_grouping_next_transaction(cx);
|
||||
buffer.set_active_selections(&self.selections, cx)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -457,6 +457,12 @@ impl MultiBuffer {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn avoid_grouping_next_transaction(&mut self, cx: &mut ModelContext<Self>) {
|
||||
for BufferState { buffer, .. } in self.buffers.borrow().values() {
|
||||
buffer.update(cx, |buffer, _| buffer.avoid_grouping_next_transaction());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_active_selections(
|
||||
&mut self,
|
||||
selections: &[Selection<Anchor>],
|
||||
|
||||
Reference in New Issue
Block a user