comparison src/ui.c @ 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 10696f279e20
children 6ffe295f7492
comparison
equal deleted inserted replaced
17737:a1fd9ff21ec0 17738:f800c3d8ca1b
1617 start_col = 0; 1617 start_col = 0;
1618 #endif 1618 #endif
1619 1619
1620 if (row == row2) 1620 if (row == row2)
1621 end_col = col2; 1621 end_col = col2;
1622 #ifdef FEAT_TEXT_PROP
1623 else if (clip_star.max_col < Columns)
1624 end_col = clip_star.max_col + 1;
1625 #endif
1622 else 1626 else
1623 #ifdef FEAT_TEXT_PROP
1624 end_col = clip_star.max_col + 1;
1625 #else
1626 end_col = Columns; 1627 end_col = Columns;
1627 #endif
1628 1628
1629 line_end_col = clip_get_line_end(&clip_star, row); 1629 line_end_col = clip_get_line_end(&clip_star, row);
1630 1630
1631 /* See if we need to nuke some trailing whitespace */ 1631 /* See if we need to nuke some trailing whitespace */
1632 if (end_col >= 1632 if (end_col >=
1795 1795
1796 if (row >= screen_Rows || ScreenLines == NULL) 1796 if (row >= screen_Rows || ScreenLines == NULL)
1797 return 0; 1797 return 0;
1798 for (i = 1798 for (i =
1799 #ifdef FEAT_TEXT_PROP 1799 #ifdef FEAT_TEXT_PROP
1800 cbd->max_col + 1; 1800 cbd->max_col >= screen_Columns ? screen_Columns : cbd->max_col + 1;
1801 #else 1801 #else
1802 screen_Columns; 1802 screen_Columns;
1803 #endif 1803 #endif
1804 i > 0; i--) 1804 i > 0; i--)
1805 if (ScreenLines[LineOffset[row] + i - 1] != ' ') 1805 if (ScreenLines[LineOffset[row] + i - 1] != ' ')