Clone fold and selection state correctly when splitting an editor

This commit is contained in:
Max Brunsfeld 2022-06-23 13:15:50 -07:00
parent 1720933597
commit fb2a7787a1
5 changed files with 74 additions and 30 deletions

View file

@ -61,6 +61,13 @@ impl SelectionsCollection {
self.buffer.read(cx).read(cx)
}
pub fn set_state(&mut self, other: &SelectionsCollection) {
self.next_selection_id = other.next_selection_id;
self.line_mode = other.line_mode;
self.disjoint = other.disjoint.clone();
self.pending = other.pending.clone();
}
pub fn count<'a>(&self) -> usize {
let mut count = self.disjoint.len();
if self.pending.is_some() {