aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mouse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/mouse.c')
-rw-r--r--src/nvim/mouse.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c
index d82ba58918..a2b4042f30 100644
--- a/src/nvim/mouse.c
+++ b/src/nvim/mouse.c
@@ -1883,33 +1883,7 @@ static void mouse_check_grid(colnr_T *vcolp, int *flagsp)
const size_t off = gp->line_offset[click_row] + (size_t)click_col;
colnr_T col_from_screen = gp->vcols[off];
- if (col_from_screen == MAXCOL) {
- // When clicking after end of line, still need to set correct curswant
- size_t off_l = gp->line_offset[click_row] + (size_t)start_col;
- if (gp->vcols[off_l] < MAXCOL) {
- // Binary search to find last char in line
- size_t off_r = off;
- while (off_l < off_r) {
- size_t off_m = (off_l + off_r + 1) / 2;
- if (gp->vcols[off_m] < MAXCOL) {
- off_l = off_m;
- } else {
- off_r = off_m - 1;
- }
- }
- colnr_T eol_vcol = gp->vcols[off_r];
- assert(eol_vcol < MAXCOL);
- if (eol_vcol < 0) {
- // Empty line or whole line before w_leftcol,
- // with columns before buffer text
- eol_vcol = curwin->w_leftcol - 1;
- }
- *vcolp = eol_vcol + (int)(off - off_r);
- } else {
- // Empty line or whole line before w_leftcol
- *vcolp = click_col - start_col + curwin->w_leftcol;
- }
- } else if (col_from_screen >= 0) {
+ if (col_from_screen >= 0) {
// Use the virtual column from vcols[], it is accurate also after
// concealed characters.
*vcolp = col_from_screen;