0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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 #4783)
This commit is contained in:
Bram Moolenaar
2019-08-16 23:09:11 +02:00
parent a3891681f7
commit d5cf89872e
2 changed files with 6 additions and 4 deletions

View File

@@ -1619,12 +1619,12 @@ clip_copy_modeless_selection(int both UNUSED)
if (row == row2) if (row == row2)
end_col = col2; end_col = col2;
else
#ifdef FEAT_TEXT_PROP #ifdef FEAT_TEXT_PROP
else if (clip_star.max_col < Columns)
end_col = clip_star.max_col + 1; end_col = clip_star.max_col + 1;
#else
end_col = Columns;
#endif #endif
else
end_col = Columns;
line_end_col = clip_get_line_end(&clip_star, row); line_end_col = clip_get_line_end(&clip_star, row);
@@ -1797,7 +1797,7 @@ clip_get_line_end(Clipboard_T *cbd UNUSED, int row)
return 0; return 0;
for (i = for (i =
#ifdef FEAT_TEXT_PROP #ifdef FEAT_TEXT_PROP
cbd->max_col + 1; cbd->max_col >= screen_Columns ? screen_Columns : cbd->max_col + 1;
#else #else
screen_Columns; screen_Columns;
#endif #endif

View File

@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1866,
/**/ /**/
1865, 1865,
/**/ /**/