0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.4568: getmousepos() does not compute the column below the last line

Problem:    getmousepos() does not compute the column below the last line.
Solution:   Also compute the column when the mouse is below the last line.
            (Sean Dewar, closes #9946)
This commit is contained in:
Sean Dewar
2022-03-15 09:46:54 +00:00
committed by Bram Moolenaar
parent 7a73252063
commit 10792feebd
3 changed files with 27 additions and 2 deletions

View File

@@ -3099,8 +3099,8 @@ f_getmousepos(typval_T *argvars UNUSED, typval_T *rettv)
col -= left_off;
if (row >= 0 && row < wp->w_height && col >= 0 && col < wp->w_width)
{
if (!mouse_comp_pos(wp, &row, &col, &lnum, NULL))
col = vcol2col(wp, lnum, col);
(void)mouse_comp_pos(wp, &row, &col, &lnum, NULL);
col = vcol2col(wp, lnum, col);
column = col + 1;
}
}