aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-core/src/state.rs')
-rw-r--r--helix-core/src/state.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/helix-core/src/state.rs b/helix-core/src/state.rs
index 5f941fb5..511df8fe 100644
--- a/helix-core/src/state.rs
+++ b/helix-core/src/state.rs
@@ -115,7 +115,6 @@ impl State {
pub fn move_selection(
&self,
- sel: Selection,
dir: Direction,
granularity: Granularity,
count: usize,
@@ -123,7 +122,7 @@ impl State {
// TODO: move all selections according to normal cursor move semantics by collapsing it
// into cursors and moving them vertically
- let ranges = sel.ranges.into_iter().map(|range| {
+ let ranges = self.selection.ranges.iter().map(|range| {
// let pos = if !range.is_empty() {
// // if selection already exists, bump it to the start or end of current select first
// if dir == Direction::Backward {
@@ -137,23 +136,22 @@ impl State {
SelectionRange::new(pos, pos)
});
- Selection::new(ranges.collect(), sel.primary_index)
+ Selection::new(ranges.collect(), self.selection.primary_index)
// TODO: update selection in state via transaction
}
pub fn extend_selection(
&self,
- sel: Selection,
dir: Direction,
granularity: Granularity,
count: usize,
) -> Selection {
- let ranges = sel.ranges.into_iter().map(|range| {
+ let ranges = self.selection.ranges.iter().map(|range| {
let pos = self.move_pos(range.head, dir, granularity, count);
SelectionRange::new(range.anchor, pos)
});
- Selection::new(ranges.collect(), sel.primary_index)
+ Selection::new(ranges.collect(), self.selection.primary_index)
// TODO: update selection in state via transaction
}
}