diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-06-05 17:11:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-05 17:11:58 +0800 |
commit | a3fba5cafcf124946ea65a68fc1b9dfbeb197525 (patch) | |
tree | c59dbad3afe3b3eb9cc5dbc7857a5a14ce7243fb /src | |
parent | 16561dac39490921715a9a8a14dab884659ffc3e (diff) | |
download | rneovim-a3fba5cafcf124946ea65a68fc1b9dfbeb197525.tar.gz rneovim-a3fba5cafcf124946ea65a68fc1b9dfbeb197525.tar.bz2 rneovim-a3fba5cafcf124946ea65a68fc1b9dfbeb197525.zip |
fix(mouse): handle folded lines with virt_lines attached to line above (#23912)
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/mouse.c | 12 | ||||
-rw-r--r-- | src/nvim/plines.c | 3 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index 8189fde83c..208956e65d 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -1310,14 +1310,13 @@ retnomove: } first = false; - if (hasFolding(curwin->w_topline, NULL, &curwin->w_topline) - && curwin->w_topline == curbuf->b_ml.ml_line_count) { - break; - } - if (curwin->w_topfill > 0) { curwin->w_topfill--; } else { + if (hasFolding(curwin->w_topline, NULL, &curwin->w_topline) + && curwin->w_topline == curbuf->b_ml.ml_line_count) { + break; + } curwin->w_topline++; curwin->w_topfill = win_get_fill(curwin, curwin->w_topline); } @@ -1403,8 +1402,7 @@ 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_may_fill(win) - && !hasFoldingWin(win, lnum, NULL, NULL, true, NULL)) { + if (win_may_fill(win)) { if (lnum == win->w_topline) { row -= win->w_topfill; } else { diff --git a/src/nvim/plines.c b/src/nvim/plines.c index 5f28715f53..523b85fd32 100644 --- a/src/nvim/plines.c +++ b/src/nvim/plines.c @@ -136,8 +136,7 @@ int plines_win_nofold(win_T *wp, linenr_T lnum) /// used from the start of the line to the given column number. int plines_win_col(win_T *wp, linenr_T lnum, long column) { - // Check for filler lines above this buffer line. When folded the result - // is one line anyway. + // Check for filler lines above this buffer line. int lines = win_get_fill(wp, lnum); if (!wp->w_p_wrap) { |