EDIT: Reduced amount of backtracking in draw_screen() to make it faster.

This commit is contained in:
Bobbi Webber-Manners 2020-08-26 21:29:01 -04:00
parent b2108c9e7c
commit 213780c5d1

View File

@ -1078,10 +1078,10 @@ void draw_screen(void) {
// First we have to scan back to work out where in the buffer to
// start drawing on the screen at the top left. This is at most
// NROWS * NCOLS chars.
// CURSORROW * NCOLS chars.
startpos = gapbegin;
if (startpos > NROWS * NCOLS)
startpos -= NROWS * NCOLS;
if (startpos > (CURSORROW + 2) * NCOLS)
startpos -= (CURSORROW + 2) * NCOLS;
else
startpos = 0;