aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mouse.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-08-08 17:36:54 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2021-09-26 12:19:54 +0200
commit392c658d4d0f9457f143748adf98ecd4cdc8dc85 (patch)
tree187943b860e19c66dbdd898661d67274c55e983f /src/nvim/mouse.c
parentb3b02eb52943fdc8ba74af3b485e9d11655bc9c9 (diff)
downloadrneovim-392c658d4d0f9457f143748adf98ecd4cdc8dc85.tar.gz
rneovim-392c658d4d0f9457f143748adf98ecd4cdc8dc85.tar.bz2
rneovim-392c658d4d0f9457f143748adf98ecd4cdc8dc85.zip
feat(decorations): support virtual lines (for now: only one block at a time)
Diffstat (limited to 'src/nvim/mouse.c')
-rw-r--r--src/nvim/mouse.c17
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 {