0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 9.0.1923: curswant wrong on click with 've' and 'wrap' set

Problem:  curswant wrong on click with 've' and 'wrap' set
Solution: Add w_leftcol to mouse click column.

closes: #13142

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
zeertzjq
2023-09-21 16:33:09 +02:00
committed by Christian Brabandt
parent a7aba6ca50
commit db54e989b5
5 changed files with 80 additions and 9 deletions

View File

@@ -2115,11 +2115,16 @@ retnomove:
else
off_r = off_m - 1;
}
col = ScreenCols[off_r] + (off_click - off_r);
colnr_T eol_vcol = ScreenCols[off_r];
if (eol_vcol < 0)
// Empty line or whole line before w_leftcol,
// with columns before buffer text
eol_vcol = curwin->w_leftcol - 1;
col = eol_vcol + (off_click - off_r);
}
else
// Clicking on an empty line
col = prev_col - curwin->w_wincol;
// Empty line or whole line before w_leftcol
col = prev_col - curwin->w_wincol + curwin->w_leftcol;
}
else if (col_from_screen >= 0)
{