refactor: add explicit command for initializing helix select mode

This commit is contained in:
CJ van den Berg 2025-11-27 16:57:59 +01:00
parent c65583b1ae
commit dd88be893e
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 7 additions and 1 deletions

View file

@ -282,7 +282,7 @@
"line_numbers": "relative", "line_numbers": "relative",
"cursor": "block", "cursor": "block",
"selection": "inclusive", "selection": "inclusive",
"init_command": ["enable_selection"], "init_command": ["init_helix_select_mode"],
"press": [ "press": [
["ctrl+b", "select_page_up"], ["ctrl+b", "select_page_up"],

View file

@ -240,6 +240,12 @@ const cmds_ = struct {
} }
pub const extend_line_below_meta: Meta = .{ .arguments = &.{.integer}, .description = "Select current line, if already selected, extend to next line" }; pub const extend_line_below_meta: Meta = .{ .arguments = &.{.integer}, .description = "Select current line, if already selected, extend to next line" };
pub fn init_helix_select_mode(_: *void, _: Ctx) Result {
_, const ed = get_context() orelse return;
try ed.enable_selection(.{});
}
pub const init_helix_select_mode_meta: Meta = .{};
pub fn move_next_word_start(_: *void, ctx: Ctx) Result { pub fn move_next_word_start(_: *void, ctx: Ctx) Result {
try move_to_word(ctx, Editor.move_cursor_word_right_vim, .forwards); try move_to_word(ctx, Editor.move_cursor_word_right_vim, .forwards);
} }