feat(keybind): move selection mode into keybind mode configuration

This commit is contained in:
CJ van den Berg 2025-01-19 19:21:44 +01:00
parent 70f0d8bea6
commit 4f5fa4a3ba
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
6 changed files with 82 additions and 72 deletions

View file

@ -951,13 +951,11 @@ const cmds = struct {
pub fn enter_helix_mode(_: *Self, _: Ctx) Result {
try @import("mode/helix.zig").init();
if (get_active_editor()) |editor| editor.enable_helix_selection = true;
}
pub const enter_helix_mode_meta = .{};
pub fn exit_helix_mode(_: *Self, _: Ctx) Result {
@import("mode/helix.zig").deinit();
if (get_active_editor()) |editor| editor.enable_helix_selection = false;
}
pub const exit_helix_mode_meta = .{};
};
@ -1174,3 +1172,7 @@ pub fn is_cursor_beam(self: *Self) bool {
else => false,
};
}
pub fn get_selection_style(self: *Self) @import("Buffer").Selection.Style {
return if (self.input_mode) |mode| mode.selection_style else .normal;
}