diff --git a/src/winio.c b/src/winio.c index 8a599019..7b403aac 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3167,10 +3167,13 @@ size_t get_softwrap_breakpoint(const char *linedata, size_t leftedge, /* If we're softwrapping at blanks and we found at least one blank, break * after that blank -- if it doesn't overshoot the screen's edge. */ if (farthest_blank != NULL) { - advance_over(farthest_blank, &last_blank_col); + size_t onestep = advance_over(farthest_blank, &last_blank_col); - if (last_blank_col <= goal_column) + if (last_blank_col <= goal_column) { + text = farthest_blank + onestep; + column = last_blank_col; return last_blank_col; + } /* If it's a tab that overshoots, break at the screen's edge. */ if (*farthest_blank == '\t')