Implement add_cursor_above and add_cursor_below for buffer
This commit is contained in:
@@ -3285,14 +3285,14 @@ mod tests {
|
||||
start: self.anchor_before(range.end)?,
|
||||
end: self.anchor_before(range.start)?,
|
||||
reversed: true,
|
||||
goal_column: None,
|
||||
goal: SelectionGoal::None,
|
||||
});
|
||||
} else {
|
||||
selections.push(Selection {
|
||||
start: self.anchor_after(range.start)?,
|
||||
end: self.anchor_before(range.end)?,
|
||||
reversed: false,
|
||||
goal_column: None,
|
||||
goal: SelectionGoal::None,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,12 +12,19 @@ use std::{cmp::Ordering, mem, ops::Range};
|
||||
pub type SelectionSetId = time::Lamport;
|
||||
pub type SelectionsVersion = usize;
|
||||
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub enum SelectionGoal {
|
||||
None,
|
||||
Column(u32),
|
||||
ColumnRange { start: u32, end: u32 },
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Selection {
|
||||
pub start: Anchor,
|
||||
pub end: Anchor,
|
||||
pub reversed: bool,
|
||||
pub goal_column: Option<u32>,
|
||||
pub goal: SelectionGoal,
|
||||
}
|
||||
|
||||
impl Selection {
|
||||
|
||||
Reference in New Issue
Block a user