aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 8e39972c..4a461239 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -161,6 +161,24 @@ pub fn move_file_end(cx: &mut Context) {
cx.doc().mode = Mode::Normal;
}
+pub fn extend_next_word_start(cx: &mut Context) {
+ let count = cx.count;
+ let selection = cx
+ .doc()
+ .state
+ .extend_selection(Direction::Forward, Granularity::Word, count);
+ cx.doc().set_selection(selection);
+}
+
+pub fn extend_prev_word_start(cx: &mut Context) {
+ let count = cx.count;
+ let selection = cx
+ .doc()
+ .state
+ .extend_selection(Direction::Backward, Granularity::Word, count);
+ cx.doc().set_selection(selection);
+}
+
pub fn check_cursor_in_view(view: &View) -> bool {
let doc = &view.doc;
let cursor = doc.selection().cursor();