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

display: limit an optimization to non-softwrap mode

Not drawing a line on a row if we're on the top row and scrolled down,
or if we're on the bottom row and scrolled up, will only work properly
if the line on that row takes up only that row.  The latter might not
be the case in softwrap mode: if the line occupies multiple chunks and
begins on that row -- in that case none of the chunks would be drawn.
No related merge requests found
Showing with 7 additions and 5 deletions
+7 -5
......@@ -2929,12 +2929,14 @@ void edit_scroll(scroll_dir direction, int nrows)
}
/* Draw new lines on any blank rows before or inside the scrolled region.
* If we scrolled down and we're on the top row, or if we scrolled up and
* we're on the bottom row, the row won't be blank, so we don't need to
* draw it unless the mark is on or we're not on the first "page". */
* If we're not in softwrap mode, we can optimize one case: if we scrolled
* forward and we're on the top row, or if we scrolled backward and we're
* on the bottom row, the row won't be blank, so we don't need to draw it
* unless the mark is on or we're not on the first "page". */
for (i = nrows; i > 0 && line != NULL; i--) {
if ((i == nrows && direction == DOWNWARD) ||
(i == 1 && direction == UPWARD)) {
if (!ISSET(SOFTWRAP) &&
((i == 1 && direction == UPWARD) ||
(i == nrows && direction == DOWNWARD))) {
if (line_needs_update(openfile->placewewant, 0))
update_line(line, (line == openfile->current) ?
openfile->current_x : 0);
......
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