From f1ea8ae8d2cbdf84c685d047e318af7e4951f827 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Wed, 25 Sep 2024 20:13:46 +0200 Subject: [PATCH] feat: add flow mode keybindings for expand_/shrink_selection --- src/tui/mode/input/flow.zig | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/tui/mode/input/flow.zig b/src/tui/mode/input/flow.zig index e31d061..78174e9 100644 --- a/src/tui/mode/input/flow.zig +++ b/src/tui/mode/input/flow.zig @@ -171,8 +171,10 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void { 'S' => self.cmd("filter", command.fmt(.{ "sort", "-u" })), 'V' => self.cmd("paste", .{}), 'I' => self.cmd("add_cursors_to_line_ends", .{}), - key.LEFT => self.cmd("move_scroll_left", .{}), - key.RIGHT => self.cmd("move_scroll_right", .{}), + key.LEFT => self.cmd("shrink_selection", .{}), + key.RIGHT => self.cmd("expand_selection", .{}), + key.HOME => self.cmd("move_scroll_left", .{}), + key.END => self.cmd("move_scroll_right", .{}), key.UP => self.cmd("add_cursor_up", .{}), key.DOWN => self.cmd("add_cursor_down", .{}), key.F12 => self.cmd("goto_type_definition", .{}), @@ -336,6 +338,7 @@ const hints = tui.KeybindHints.initComptime(.{ .{ "dupe_up", "S-A-d" }, .{ "enable_fast_scroll", "hold Ctrl" }, .{ "enable_jump_mode", "hold Alt" }, + .{ "expand_selection", "S-A-right" }, .{ "filter", "A-s" }, // self.cmd("filter", command.fmt(.{"sort"})), // .{ "filter", "S-A-s" }, // self.cmd("filter", command.fmt(.{ "sort", "-u" })), .{ "find", "C-f" }, @@ -366,10 +369,10 @@ const hints = tui.KeybindHints.initComptime(.{ .{ "move_page_up", "pgup" }, .{ "move_right", "right" }, .{ "move_scroll_down", "C-down" }, - .{ "move_scroll_left", "S-A-left" }, + .{ "move_scroll_left", "S-A-home" }, .{ "move_scroll_page_down", "C-pgdn" }, .{ "move_scroll_page_up", "C-pgup" }, - .{ "move_scroll_right", "S-A-right" }, + .{ "move_scroll_right", "S-A-end" }, .{ "move_scroll_up", "C-up" }, .{ "move_to_char", "C-b, C-t" }, // true/false .{ "move_up", "up" }, @@ -408,6 +411,7 @@ const hints = tui.KeybindHints.initComptime(.{ .{ "select_word_left", "C-S-left" }, .{ "select_word_right", "C-S-right" }, .{ "show_diagnostics", "C-S-m" }, + .{ "shrink_selection", "S-A-left" }, .{ "smart_insert_line_after", "C-enter" }, .{ "smart_insert_line_before", "S-enter, C-S-enter" }, .{ "smart_insert_line", "enter" },