0
0
mirror of https://github.com/vim/vim.git synced 2025-07-24 10:45:12 -04:00

updated for version 7.4.578

Problem:    Using getcurpos() after "$" in an empty line returns a negative
            number.
Solution:   Don't add one when this would overflow. (Hirohito Higashi)
This commit is contained in:
Bram Moolenaar 2015-01-14 19:00:38 +01:00
parent a20bcad15c
commit 084abaec06
2 changed files with 4 additions and 1 deletions

View File

@ -11941,7 +11941,8 @@ getpos_both(argvars, rettv, getcurpos)
#endif
(varnumber_T)0);
if (getcurpos)
list_append_number(l, (varnumber_T)curwin->w_curswant + 1);
list_append_number(l, curwin->w_curswant == MAXCOL ?
(varnumber_T)MAXCOL : (varnumber_T)curwin->w_curswant + 1);
}
else
rettv->vval.v_number = FALSE;

View File

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