Commit ee8681d7 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey Committed by Benno Schulenberg
Browse files

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

A line can only be partially offscreen when doing softwrapping.
parent a1fba434
Showing with 7 additions and 5 deletions
+7 -5
......@@ -2949,12 +2949,14 @@ void edit_scroll(scroll_dir direction, int nrows)
go_forward_chunks(editwinrows - nrows, &line, &leftedge);
#ifndef NANO_TINY
/* Compensate for the earlier chunks of a softwrapped line. */
nrows += chunk_for(leftedge, line);
if (ISSET(SOFTWRAP)) {
/* Compensate for the earlier chunks of a softwrapped line. */
nrows += chunk_for(leftedge, line);
/* Don't compensate for the chunks that are offscreen. */
if (line == openfile->edittop)
nrows -= chunk_for(openfile->firstcolumn, line);
/* Don't compensate for the chunks that are offscreen. */
if (line == openfile->edittop)
nrows -= chunk_for(openfile->firstcolumn, line);
}
#endif
/* Draw new content on the blank rows inside the scrolled region
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment