From c143eb6a59eb98cd1242b1dac0a37815ae98cb2d Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 14 Aug 2025 16:29:46 +0200 Subject: [PATCH] fix: also hide inputbox icons if show_fileicons config option is off --- src/tui/InputBox.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tui/InputBox.zig b/src/tui/InputBox.zig index 706eaa5..4d63aea 100644 --- a/src/tui/InputBox.zig +++ b/src/tui/InputBox.zig @@ -32,8 +32,9 @@ pub fn Options(context: type) type { self.plane.fill(" "); self.plane.home(); for (0..self.opts.padding) |_| _ = self.plane.putchar(" "); - if (self.opts.icon) |icon| + if (self.icon_width > 0) if (self.opts.icon) |icon| { _ = self.plane.print("{s}", .{icon}) catch {}; + }; if (self.text.items.len > 0) { _ = self.plane.print("{s} ", .{self.text.items}) catch {}; } else { @@ -73,7 +74,7 @@ pub fn create(ctx_type: type, allocator: std.mem.Allocator, parent: Plane, opts: .opts = opts, .label = std.ArrayList(u8).init(allocator), .text = std.ArrayList(u8).init(allocator), - .icon_width = @intCast(if (opts.icon) |icon| n.egc_chunk_width(icon, 0, 1) else 0), + .icon_width = @intCast(if (tui.config().show_fileicons) if (opts.icon) |icon| n.egc_chunk_width(icon, 0, 1) else 0 else 0), }; try self.label.appendSlice(self.opts.label); self.opts.label = self.label.items;