fix: render highlight columns only based on the absolute column
closes #392
This commit is contained in:
parent
b52b06735b
commit
44a48510fd
1 changed files with 7 additions and 7 deletions
|
|
@ -1279,18 +1279,18 @@ pub const Editor = struct {
|
||||||
const hl_cols: []const u16 = tui.highlight_columns();
|
const hl_cols: []const u16 = tui.highlight_columns();
|
||||||
const alpha: u8 = tui.config().highlight_columns_alpha;
|
const alpha: u8 = tui.config().highlight_columns_alpha;
|
||||||
const offset = self.view.col;
|
const offset = self.view.col;
|
||||||
for (hl_cols) |hl_col_| {
|
for (hl_cols) |hl_col| {
|
||||||
if (hl_col_ < offset) continue;
|
if (hl_col > (self.view.cols + offset)) continue;
|
||||||
const hl_col = hl_col_ - offset;
|
for (0..self.view.rows) |row| for (0..self.view.cols) |col| {
|
||||||
if (hl_col > self.view.cols) continue;
|
const view_col = col + offset;
|
||||||
for (0..self.view.rows) |row| for (0..self.view.cols) |col|
|
if (hl_col <= view_col) {
|
||||||
if (hl_col > 0 and hl_col <= col) {
|
|
||||||
self.plane.cursor_move_yx(@intCast(row), @intCast(col)) catch return;
|
self.plane.cursor_move_yx(@intCast(row), @intCast(col)) catch return;
|
||||||
var cell = self.plane.cell_init();
|
var cell = self.plane.cell_init();
|
||||||
_ = self.plane.at_cursor_cell(&cell) catch return;
|
_ = self.plane.at_cursor_cell(&cell) catch return;
|
||||||
cell.dim_bg(alpha);
|
cell.dim_bg(alpha);
|
||||||
_ = self.plane.putc(&cell) catch {};
|
_ = self.plane.putc(&cell) catch {};
|
||||||
};
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue