aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src/commands.rs')
-rw-r--r--helix-view/src/commands.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/helix-view/src/commands.rs b/helix-view/src/commands.rs
index 6dd1101c..eb9aaf6f 100644
--- a/helix-view/src/commands.rs
+++ b/helix-view/src/commands.rs
@@ -117,6 +117,24 @@ pub fn move_next_word_end(view: &mut View, count: usize) {
view.state.selection = Selection::single(pos, pos);
}
+pub fn move_file_start(view: &mut View, count: usize) {
+ // TODO: use a transaction
+ view.state.selection = view
+ .state
+ .move_selection(Direction::Backward, Granularity::Line, count);
+
+ view.state.mode = Mode::Normal;
+}
+
+pub fn move_file_end(view: &mut View, count: usize) {
+ // TODO: use a transaction
+ view.state.selection = view
+ .state
+ .move_selection(Direction::Forward, Granularity::Line, count);
+
+ view.state.mode = Mode::Normal;
+}
+
// avoid select by default by having a visual mode switch that makes movements into selects
pub fn extend_char_left(view: &mut View, count: usize) {
@@ -292,6 +310,10 @@ pub fn normal_mode(view: &mut View, _count: usize) {
}
}
+pub fn goto_mode(view: &mut View, _count: usize) {
+ view.state.mode = Mode::Goto;
+}
+
// TODO: insert means add text just before cursor, on exit we should be on the last letter.
pub fn insert_char(view: &mut View, c: char) {
let c = Tendril::from_char(c);