commit 902b4674f990e2b5171f78e4e73e0c6c90fc3b6f
parent 37be9b54ca9248d40a1a2155413f9619ca8d04bc
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 14 Mar 2019 16:48:20 +0100
display: account for horizontal scrolling when drawing the guide stripe
That is, draw the stripe relative to the column at which the current
"chunk" starts.
This fixes https://savannah.gnu.org/bugs/?55920.
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -2685,12 +2685,13 @@ void edit_draw(filestruct *fileptr, const char *converted,
}
#endif /* ENABLE_COLOR */
- if (stripe_column > 0 && !inhelp) {
- const char *text = converted + actual_x(converted, stripe_column - 1);
+ if (stripe_column > from_col && !inhelp) {
+ const ssize_t target_column = stripe_column - from_col - 1;
+ const char *text = converted + actual_x(converted, target_column);
const char *striped_char = (*text == '\0') ? " " : text;
wattron(edit, interface_color_pair[GUIDE_STRIPE]);
- mvwaddnstr(edit, row, margin + stripe_column - 1, striped_char, 1);
+ mvwaddnstr(edit, row, margin + target_column, striped_char, 1);
wattroff(edit, interface_color_pair[GUIDE_STRIPE]);
}