diff options
| author | Björn Linse <bjorn.linse@gmail.com> | 2019-02-07 21:41:45 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-07 21:41:45 +0100 |
| commit | f6faeea41c70015f6d9b63fecaf80d106cd2636d (patch) | |
| tree | 00be473f5509a9cc085a64ab29b0fadb9f9412b3 /src/nvim/move.c | |
| parent | fa2580f953204e919a13388ce5af2edf3afd0594 (diff) | |
| parent | be8058cfe4b7adff60a68d9503a01e322d7d2ff9 (diff) | |
| download | rneovim-f6faeea41c70015f6d9b63fecaf80d106cd2636d.tar.gz rneovim-f6faeea41c70015f6d9b63fecaf80d106cd2636d.tar.bz2 rneovim-f6faeea41c70015f6d9b63fecaf80d106cd2636d.zip | |
Merge pull request #9586 from bfredl/screencleanup
screen: cleanup allocation and scrolling
Diffstat (limited to 'src/nvim/move.c')
| -rw-r--r-- | src/nvim/move.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c index 610fd04ebc..7aa7f922c1 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -152,7 +152,7 @@ void update_topline(void) // If there is no valid screen and when the window height is zero just use // the cursor line. - if (!screen_valid(true) || curwin->w_height_inner == 0) { + if (!default_grid.chars || curwin->w_height_inner == 0) { curwin->w_topline = curwin->w_cursor.lnum; curwin->w_botline = curwin->w_topline; curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; @@ -925,12 +925,9 @@ void curs_columns( curwin->w_wrow -= extra; } + // extra could be either positive or negative extra = ((int)prev_skipcol - (int)curwin->w_skipcol) / width; - if (extra > 0) { - win_ins_lines(curwin, 0, extra); - } else if (extra < 0) { - win_del_lines(curwin, 0, -extra); - } + win_scroll_lines(curwin, 0, extra); } else { curwin->w_skipcol = 0; } |