aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/commands.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-10-01 09:44:46 +0000
committerBlaž Hrastnik2020-10-01 09:44:46 +0000
commit77d75d92752835e2953b4a70f7ee8a9aeaff9fa0 (patch)
treea5937ed41fc5acd8977485a6f615481056c58c0e /helix-view/src/commands.rs
parent5945815d978da07d0970502d481c17ef02525c4d (diff)
Collapse cursors command (;).
Diffstat (limited to 'helix-view/src/commands.rs')
-rw-r--r--helix-view/src/commands.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/helix-view/src/commands.rs b/helix-view/src/commands.rs
index 93ec2632..1fb9c90e 100644
--- a/helix-view/src/commands.rs
+++ b/helix-view/src/commands.rs
@@ -168,6 +168,13 @@ pub fn change_selection(view: &mut View, count: usize) {
insert_mode(view, count);
}
+pub fn collapse_selection(view: &mut View, _count: usize) {
+ view.state.selection = view
+ .state
+ .selection
+ .transform(|range| Range::new(range.head, range.head))
+}
+
// insert mode:
// first we calculate the correct cursors/selections
// then we just append at each cursor