• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Révision0969f82fbbff35561fd049bab15f161819de5fb4 (tree)
l'heure2019-11-19 07:45:03
AuteurBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Message de Log

patch 8.1.2321: cannot select all text with the mouse

Commit: https://github.com/vim/vim/commit/0a5aa7b28a39507260acb15c1ef698a33c855cc1
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Nov 18 23:31:48 2019 +0100

patch 8.1.2321: cannot select all text with the mouse
Problem: Cannot select all text with the mouse. (John Marriott)
Solution: Move limiting the mouse column to f_getmousepos(). (closes https://github.com/vim/vim/issues/5242)

Change Summary

Modification

diff -r 0e6db1821963 -r 0969f82fbbff src/mouse.c
--- a/src/mouse.c Mon Nov 18 22:15:04 2019 +0100
+++ b/src/mouse.c Mon Nov 18 23:45:03 2019 +0100
@@ -2822,7 +2822,6 @@
28222822 int retval = FALSE;
28232823 int off;
28242824 int count;
2825- char_u *p;
28262825
28272826 #ifdef FEAT_RIGHTLEFT
28282827 if (win->w_p_rl)
@@ -2882,11 +2881,6 @@
28822881 col += row * (win->w_width - off);
28832882 // add skip column (for long wrapping line)
28842883 col += win->w_skipcol;
2885- // limit to text length plus one
2886- p = ml_get_buf(win->w_buffer, lnum, FALSE);
2887- count = (int)STRLEN(p);
2888- if (col > count)
2889- col = count;
28902884 }
28912885
28922886 if (!win->w_p_wrap)
@@ -3053,7 +3047,17 @@
30533047 col -= left_off;
30543048 if (row >= 0 && row < wp->w_height && col >= 0 && col < wp->w_width)
30553049 {
3050+ char_u *p;
3051+ int count;
3052+
30563053 mouse_comp_pos(wp, &row, &col, &line, NULL);
3054+
3055+ // limit to text length plus one
3056+ p = ml_get_buf(wp->w_buffer, line, FALSE);
3057+ count = (int)STRLEN(p);
3058+ if (col > count)
3059+ col = count;
3060+
30573061 column = col + 1;
30583062 }
30593063 }
diff -r 0e6db1821963 -r 0969f82fbbff src/version.c
--- a/src/version.c Mon Nov 18 22:15:04 2019 +0100
+++ b/src/version.c Mon Nov 18 23:45:03 2019 +0100
@@ -742,6 +742,8 @@
742742 static int included_patches[] =
743743 { /* Add new patch number below this line */
744744 /**/
745+ 2321,
746+/**/
745747 2320,
746748 /**/
747749 2319,
Afficher sur ancien navigateur de dépôt.