mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 9.0.1919: Wrong curswant when clicking on empty line or with vsplits
Problem: Wrong curswant when clicking on empty line or with vsplits. Solution: Don't check for ScreenCols[] before the start of the window and handle empty line properly. closes: #13132 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
committed by
Christian Brabandt
parent
5790a54166
commit
03cd697d63
@@ -2101,11 +2101,11 @@ retnomove:
|
||||
if (col_from_screen == MAXCOL)
|
||||
{
|
||||
// When clicking after end of line, still need to set correct curswant
|
||||
int off_l = LineOffset[prev_row];
|
||||
int off_l = LineOffset[prev_row] + curwin->w_wincol;
|
||||
if (ScreenCols[off_l] < MAXCOL)
|
||||
{
|
||||
// Binary search to find last char in line
|
||||
int off_r = off_l + prev_col;
|
||||
int off_r = LineOffset[prev_row] + prev_col;
|
||||
int off_click = off_r;
|
||||
while (off_l < off_r)
|
||||
{
|
||||
@@ -2118,8 +2118,8 @@ retnomove:
|
||||
col = ScreenCols[off_r] + (off_click - off_r);
|
||||
}
|
||||
else
|
||||
// Shouldn't normally happen
|
||||
col = MAXCOL;
|
||||
// Clicking on an empty line
|
||||
col = prev_col - curwin->w_wincol;
|
||||
}
|
||||
else if (col_from_screen >= 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user