Merge branch 'master' into zig-0.14

This commit is contained in:
CJ van den Berg 2025-02-19 21:36:09 +01:00
commit 90bacba8d5
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
4 changed files with 19 additions and 12 deletions

View file

@ -30,13 +30,13 @@ const Operation = enum {
};
pub fn create(allocator: Allocator, ctx: command.Context) !struct { tui.Mode, tui.MiniMode } {
var right: bool = true;
var direction: Direction = undefined;
const select = if (tui.get_active_editor()) |editor| if (editor.get_primary().selection) |_| true else false else false;
_ = ctx.args.match(.{tp.extract(&right)}) catch return error.InvalidMoveToCharArgument;
_ = ctx.args.match(.{tp.extract(&direction)}) catch return error.InvalidMoveToCharArgument;
const self: *Self = try allocator.create(Self);
self.* = .{
.allocator = allocator,
.direction = if (right) .right else .left,
.direction = direction,
.operation = if (select) .select else .move,
};
try self.commands.init(self);