aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2020-02-07 10:20:56 +0100
committerMarc André Tanner <mat@brain-dump.org>2020-02-07 10:20:56 +0100
commitbbfd35ae98d13bf0e94eadef37abb7bb5748382a (patch)
tree0156dd8cb903bc61d405f4d19c51c2041f62b954 /vis.c
parent05067a24028eaedae01beb248c4409dc5d980862 (diff)
parent8b61028df40751f4e9f2098fdb9a17013d7f1c8a (diff)
downloadvis-bbfd35ae98d13bf0e94eadef37abb7bb5748382a.tar.gz
vis-bbfd35ae98d13bf0e94eadef37abb7bb5748382a.tar.xz
Merge branch 'fix-cc-cell' of https://github.com/zsugabubus/vis
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/vis.c b/vis.c
index 447d4a3..59bb2a1 100644
--- a/vis.c
+++ b/vis.c
@@ -286,17 +286,18 @@ static void window_draw_colorcolumn(Win *win) {
if (l->lineno != lineno) {
line_cols = 0;
line_cc_set = false;
- lineno = l->lineno;
+ if (!(lineno = l->lineno))
+ break;
}
-
if (line_cc_set)
continue;
- line_cols += width;
/* This screen line contains the cell we want to highlight */
- if (line_cols >= cc) {
- l->cells[(cc - 1) % width].style = style;
+ if (cc <= line_cols + width) {
+ l->cells[(cc - 1) - line_cols].style = style;
line_cc_set = true;
+ } else {
+ line_cols += width;
}
}
}