mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 18:36:30 +00:00
fix(mouse): handle folded lines with virt_lines attached to line above (#23912)
This commit is contained in:
@@ -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 {
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user