1
1

tweaks: only compensate for a partially-offscreen line in softwrap mode

A line can only be partially offscreen when doing softwrapping.
Этот коммит содержится в:
David Lawrence Ramsey 2017-07-19 22:14:21 -05:00 коммит произвёл Benno Schulenberg
родитель a1fba43452
Коммит ee8681d7cc

Просмотреть файл

@ -2949,12 +2949,14 @@ void edit_scroll(scroll_dir direction, int nrows)
go_forward_chunks(editwinrows - nrows, &line, &leftedge); go_forward_chunks(editwinrows - nrows, &line, &leftedge);
#ifndef NANO_TINY #ifndef NANO_TINY
if (ISSET(SOFTWRAP)) {
/* Compensate for the earlier chunks of a softwrapped line. */ /* Compensate for the earlier chunks of a softwrapped line. */
nrows += chunk_for(leftedge, line); nrows += chunk_for(leftedge, line);
/* Don't compensate for the chunks that are offscreen. */ /* Don't compensate for the chunks that are offscreen. */
if (line == openfile->edittop) if (line == openfile->edittop)
nrows -= chunk_for(openfile->firstcolumn, line); nrows -= chunk_for(openfile->firstcolumn, line);
}
#endif #endif
/* Draw new content on the blank rows inside the scrolled region /* Draw new content on the blank rows inside the scrolled region