From 07a2c19b9d298617586f98561754d0a241c7a473 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Fri, 18 Apr 2025 21:41:01 +0200 Subject: [PATCH] fix: side scrolling of highlight_columns --- src/tui/editor.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index ceb6c1d..f1ff62b 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -1137,7 +1137,11 @@ pub const Editor = struct { defer frame.deinit(); const hl_cols: []const u16 = tui.highlight_columns(); const alpha: u8 = tui.config().highlight_columns_alpha; - for (hl_cols) |hl_col| { + const offset = self.view.col; + for (hl_cols) |hl_col_| { + if (hl_col_ < offset) continue; + const hl_col = hl_col_ - offset; + if (hl_col > self.view.cols) continue; for (0..self.view.rows) |row| for (0..self.view.cols) |col| if (hl_col > 0 and hl_col <= col) { self.plane.cursor_move_yx(@intCast(row), @intCast(col)) catch return;