diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-09-26 16:56:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-26 16:56:19 +0200 |
commit | d4fa1649fbafe7bedb4bee0b014dd4723ad0ee97 (patch) | |
tree | 55324b1771b69ff551677801e328d76215d1d4cd /src/nvim/normal.c | |
parent | c273eb310098a4ddae577401aca5e07b45107f48 (diff) | |
parent | 392c658d4d0f9457f143748adf98ecd4cdc8dc85 (diff) | |
download | rneovim-d4fa1649fbafe7bedb4bee0b014dd4723ad0ee97.tar.gz rneovim-d4fa1649fbafe7bedb4bee0b014dd4723ad0ee97.tar.bz2 rneovim-d4fa1649fbafe7bedb4bee0b014dd4723ad0ee97.zip |
Merge pull request #15351 from bfredl/virt_line
feat(screen): virtual lines
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index b8a62a8fea..17ec5cd3be 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -5261,16 +5261,15 @@ static void nv_scroll(cmdarg_T *cap) } else { if (cap->cmdchar == 'M') { // Don't count filler lines above the window. - used -= diff_check_fill(curwin, curwin->w_topline) + used -= win_get_fill(curwin, curwin->w_topline) - curwin->w_topfill; validate_botline(curwin); // make sure w_empty_rows is valid half = (curwin->w_height_inner - curwin->w_empty_rows + 1) / 2; for (n = 0; curwin->w_topline + n < curbuf->b_ml.ml_line_count; n++) { // Count half he number of filler lines to be "below this // line" and half to be "above the next line". - if (n > 0 && used + diff_check_fill(curwin, curwin->w_topline - + n) / 2 >= half) { - --n; + if (n > 0 && used + win_get_fill(curwin, curwin->w_topline + n) / 2 >= half) { + n--; break; } used += plines_win(curwin, curwin->w_topline + n, true); |