changeset 17738:f800c3d8ca1b v8.1.1866

patch 8.1.1866: modeless selection in GUI does not work properly commit https://github.com/vim/vim/commit/d5cf89872e6185c4d97cd254a9d697b8c3bdbf94 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 16 23:09:11 2019 +0200 patch 8.1.1866: modeless selection in GUI does not work properly Problem: Modeless selection in GUI does not work properly. Solution: Avoid going beyond the end of the line. (closes https://github.com/vim/vim/issues/4783)
author Bram Moolenaar <Bram@vim.org>
date Fri, 16 Aug 2019 23:15:03 +0200
parents a1fd9ff21ec0
children 0ea79ae89615
files src/ui.c src/version.c
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/ui.c
+++ b/src/ui.c
@@ -1619,12 +1619,12 @@ clip_copy_modeless_selection(int both UN
 
 	if (row == row2)
 	    end_col = col2;
-	else
 #ifdef FEAT_TEXT_PROP
+	else if (clip_star.max_col < Columns)
 	    end_col = clip_star.max_col + 1;
-#else
+#endif
+	else
 	    end_col = Columns;
-#endif
 
 	line_end_col = clip_get_line_end(&clip_star, row);
 
@@ -1797,7 +1797,7 @@ clip_get_line_end(Clipboard_T *cbd UNUSE
 	return 0;
     for (i =
 #ifdef FEAT_TEXT_PROP
-	    cbd->max_col + 1;
+	    cbd->max_col >= screen_Columns ? screen_Columns : cbd->max_col + 1;
 #else
 	    screen_Columns;
 #endif
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1866,
+/**/
     1865,
 /**/
     1864,