diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-01-14 19:00:38 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-01-14 19:00:38 +0100 |
commit | 084abaec061f830e2d389c416499d013e47fb0db (patch) | |
tree | c7fcf6cdd256c6b0076f3675de8cd99288a10118 /src | |
parent | a20bcad15c826a8c43a0f66a6b438bb5a14c8196 (diff) | |
download | vim-084abaec061f830e2d389c416499d013e47fb0db.zip |
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)
Diffstat (limited to 'src')
-rw-r--r-- | src/eval.c | 3 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 50e87081f..e6175f6ba 100644 --- a/src/eval.c +++ b/src/eval.c @@ -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; diff --git a/src/version.c b/src/version.c index 1367621f4..7a54fc285 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 578, +/**/ 577, /**/ 576, |