softwrap: adjust for current_x when computing the amount to scroll
The number of lines to scroll is: the y position of the start of the current line, plus the extra lines that this line occupies, plus the extra lines that the next line occupies, plus one, minus the y position of the last window line. The y position of the start of the current line is current_y - xplustabs() / COLS, the extra lines are strlenpt(data) / COLS, and the y position of the last window line is editwinrows - 1. Note that we first compute the amount to scroll before actually moving to the next line, because we need the current value of current_x, not the one that it will have in the next line. The placewewant value is not good either, because it might be beyond where we actually are. This fixes https://savannah.gnu.org/bugs/?47665.
Showing
+9 -8
Please register or sign in to comment