From 9821beb5c4b36f7c34ae6a5cb014b3eb68b9233a Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Mon, 7 Jun 2021 23:32:44 +0900 Subject: Make gh/gl extend selection in select mode --- helix-term/src/commands.rs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'helix-term') diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 94175006..00556e18 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1276,17 +1276,19 @@ pub fn goto_mode(cx: &mut Context) { } = event { // TODO: temporarily show GOTO in the mode list - match ch { - 'g' => move_file_start(cx), - 'e' => move_file_end(cx), - 'h' => move_line_start(cx), - 'l' => move_line_end(cx), - 'd' => goto_definition(cx), - 'y' => goto_type_definition(cx), - 'r' => goto_reference(cx), - 'i' => goto_implementation(cx), - - 't' | 'm' | 'b' => { + match (cx.doc().mode, ch) { + (_, 'g') => move_file_start(cx), + (_, 'e') => move_file_end(cx), + (Mode::Normal, 'h') => move_line_start(cx), + (Mode::Normal, 'l') => move_line_end(cx), + (Mode::Select, 'h') => extend_line_start(cx), + (Mode::Select, 'l') => extend_line_end(cx), + (_, 'd') => goto_definition(cx), + (_, 'y') => goto_type_definition(cx), + (_, 'r') => goto_reference(cx), + (_, 'i') => goto_implementation(cx), + + (_, 't') | (_, 'm') | (_, 'b') => { let (view, doc) = cx.current(); let pos = doc.selection(view.id).cursor(); -- cgit v1.2.3-70-g09d2