feat: BREAKING make highlight_columns a list of integers
This commit is contained in:
parent
46dfde7685
commit
30c6ac0e82
2 changed files with 1 additions and 17 deletions
|
@ -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",
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue