display: do not attempt to draw a line that is outside the viewport

When we're on the last row in the viewport, it is unwise to try and draw
the next line.

This fixes https://savannah.gnu.org/bugs/?65539.
The issue was reported by `correctmost`.

Bug existed since commit c2322f85 from three days ago.
This commit is contained in:
Benno Schulenberg 2024-03-30 10:39:10 +01:00
parent 02d50bd4aa
commit 17abce073f
1 changed files with 2 additions and 1 deletions

View File

@ -1522,7 +1522,8 @@ void inject(char *burst, size_t count)
#else
if (margin)
#endif
update_line(thisline->next, 0);
if (openfile->current_y < editwinrows - 1)
update_line(thisline->next, 0);
}
#ifndef NANO_TINY