Patch 8.1.2321

10 views
Skip to first unread message

Bram Moolenaar

unread,
Nov 18, 2019, 5:32:30 PM11/18/19
to vim...@googlegroups.com

Patch 8.1.2321
Problem: Cannot select all text with the mouse. (John Marriott)
Solution: Move limiting the mouse column to f_getmousepos(). (closes #5242)
Files: src/mouse.c


*** ../vim-8.1.2320/src/mouse.c 2019-11-18 21:38:33.747362315 +0100
--- src/mouse.c 2019-11-18 23:22:01.873922447 +0100
***************
*** 2822,2828 ****
int retval = FALSE;
int off;
int count;
- char_u *p;

#ifdef FEAT_RIGHTLEFT
if (win->w_p_rl)
--- 2822,2827 ----
***************
*** 2882,2892 ****
col += row * (win->w_width - off);
// add skip column (for long wrapping line)
col += win->w_skipcol;
- // limit to text length plus one
- p = ml_get_buf(win->w_buffer, lnum, FALSE);
- count = (int)STRLEN(p);
- if (col > count)
- col = count;
}

if (!win->w_p_wrap)
--- 2881,2886 ----
***************
*** 3053,3059 ****
--- 3047,3063 ----
col -= left_off;
if (row >= 0 && row < wp->w_height && col >= 0 && col < wp->w_width)
{
+ char_u *p;
+ int count;
+
mouse_comp_pos(wp, &row, &col, &line, NULL);
+
+ // limit to text length plus one
+ p = ml_get_buf(wp->w_buffer, line, FALSE);
+ count = (int)STRLEN(p);
+ if (col > count)
+ col = count;
+
column = col + 1;
}
}
*** ../vim-8.1.2320/src/version.c 2019-11-18 22:02:12.812154964 +0100
--- src/version.c 2019-11-18 23:17:11.534492205 +0100
***************
*** 743,744 ****
--- 743,746 ----
{ /* Add new patch number below this line */
+ /**/
+ 2321,
/**/

--
I AM THANKFUL...
...for the mess to clean after a party because it means I have
been surrounded by friends.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages