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/mouse.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/mouse.c')
-rw-r--r-- | src/nvim/mouse.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index b65d87e617..cf463fd40a 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -241,7 +241,7 @@ retnomove: if (row < 0) { count = 0; for (first = true; curwin->w_topline > 1; ) { - if (curwin->w_topfill < diff_check(curwin, curwin->w_topline)) { + if (curwin->w_topfill < win_get_fill(curwin, curwin->w_topline)) { count++; } else { count += plines_win(curwin, curwin->w_topline - 1, true); @@ -251,8 +251,8 @@ retnomove: } first = false; (void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL); - if (curwin->w_topfill < diff_check(curwin, curwin->w_topline)) { - ++curwin->w_topfill; + if (curwin->w_topfill < win_get_fill(curwin, curwin->w_topline)) { + curwin->w_topfill++; } else { --curwin->w_topline; curwin->w_topfill = 0; @@ -283,11 +283,10 @@ retnomove: } if (curwin->w_topfill > 0) { - --curwin->w_topfill; + curwin->w_topfill--; } else { - ++curwin->w_topline; - curwin->w_topfill = - diff_check_fill(curwin, curwin->w_topline); + curwin->w_topline++; + curwin->w_topfill = win_get_fill(curwin, curwin->w_topline); } } check_topfill(curwin, false); @@ -373,12 +372,12 @@ bool mouse_comp_pos(win_T *win, int *rowp, int *colp, linenr_T *lnump) while (row > 0) { // Don't include filler lines in "count" - if (win->w_p_diff + if (win_may_fill(win) && !hasFoldingWin(win, lnum, NULL, NULL, true, NULL)) { if (lnum == win->w_topline) { row -= win->w_topfill; } else { - row -= diff_check_fill(win, lnum); + row -= win_get_fill(win, lnum); } count = plines_win_nofill(win, lnum, true); } else { |