From 3fdee5e532f983ec0a151926c9df1ffdd5eb8c82 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 16 Dec 2025 23:08:42 +0100 Subject: [PATCH] feat: expand variables in arguments to filters --- src/tui/editor.zig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index e5eac8c..a3f317f 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -6229,7 +6229,14 @@ pub const Editor = struct { } pub const filter_meta: Meta = .{ .arguments = &.{.string} }; - fn filter_cmd(self: *Self, cmd: tp.message) !void { + fn filter_cmd(self: *Self, cmd_: tp.message) !void { + const expansion = @import("expansion.zig"); + const args = expansion.expand_cbor(self.allocator, cmd_.buf) catch |e| switch (e) { + error.NotFound => return error.Stop, + else => |e_| return e_, + }; + const cmd: tp.message = .{ .buf = args }; + defer self.allocator.free(args); if (self.filter_) |_| return error.Stop; const root = self.buf_root() catch return; const buf_a_ = try self.buf_a();