diff --git a/src/config.zig b/src/config.zig index 91e3cdd..257f6bb 100644 --- a/src/config.zig +++ b/src/config.zig @@ -10,7 +10,7 @@ enable_terminal_cursor: bool = true, enable_terminal_color_scheme: bool = builtin.os.tag != .windows, highlight_current_line: bool = true, highlight_current_line_gutter: bool = true, -highlight_columns: []const u8 = "80 100 120", +highlight_columns: []const u16 = &.{ 80, 100, 120 }, highlight_columns_alpha: u8 = 240, highlight_columns_enabled: bool = false, whitespace_mode: []const u8 = "none", diff --git a/src/tui/tui.zig b/src/tui/tui.zig index 844af57..6472742 100644 --- a/src/tui/tui.zig +++ b/src/tui/tui.zig @@ -119,15 +119,6 @@ fn init(allocator: Allocator) InitError!*Self { const frame_time = std.time.us_per_s / conf.frame_rate; const frame_clock = try tp.metronome.init(frame_time); - const hl_cols: usize = blk: { - var it = std.mem.splitScalar(u8, conf.highlight_columns, ' '); - var idx: usize = 0; - while (it.next()) |_| - idx += 1; - break :blk idx; - }; - const highlight_columns__ = try allocator.alloc(u16, hl_cols); - var self = try allocator.create(Self); self.* = .{ .allocator = allocator, @@ -154,13 +145,6 @@ fn init(allocator: Allocator) InitError!*Self { instance_ = self; defer instance_ = null; - var it = std.mem.splitScalar(u8, conf.highlight_columns, ' '); - var idx: usize = 0; - while (it.next()) |arg| { - highlight_columns__[idx] = std.fmt.parseInt(u16, arg, 10) catch 0; - idx += 1; - } - self.default_cursor = std.meta.stringToEnum(keybind.CursorShape, conf.default_cursor) orelse .default; self.config_.default_cursor = @tagName(self.default_cursor); self.rdr_.handler_ctx = self;