feat: implement helix keep_primary_selection

This commit is contained in:
CJ van den Berg 2025-12-04 17:11:25 +01:00
parent 090d27d890
commit 791b184583
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 12 additions and 2 deletions

View file

@ -488,6 +488,16 @@ const cmds_ = struct {
ed.need_render();
}
pub const replace_with_character_helix_meta: Meta = .{ .description = "Replace with character" };
pub fn keep_primary_selection(_: *void, _: Ctx) Result {
const mv = tui.mainview() orelse return;
const ed = mv.get_active_editor() orelse return;
const primary = ed.get_primary().*;
ed.cancel_all_selections();
ed.cancel_all_matches();
ed.get_primary().* = primary;
}
pub const keep_primary_selection_meta: Meta = .{};
};
fn match_bracket(root: Buffer.Root, cursel: *CurSel, ctx: command.Context, metrics: Buffer.Metrics) error{Stop}!void {