diff --git a/src/winio.c b/src/winio.c index 7fbc1272b053dda3fbe1924162770c97b6032f01..0b2abcbbdb9e0d00d4bd13652e392c6ec4378e2e 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2624,6 +2624,9 @@ void edit_draw(filestruct *fileptr, const char *converted, /* Compute on which screen column to start painting. */ start_col = strnlenpt(fileptr->data, top_x) - from_col; + if (start_col < 0) + start_col = 0; + thetext = converted + actual_x(converted, start_col); /* If the end of the mark is onscreen, compute how many