vim-patch: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)

https://code.google.com/p/vim/source/detail?r=v7-4-578
This commit is contained in:
oni-link
2015-03-04 17:57:47 +01:00
parent a4c3ac2799
commit 0dd1ad0760
2 changed files with 4 additions and 2 deletions

View File

@@ -9479,7 +9479,9 @@ static void getpos_both(typval_T *argvars, typval_T *rettv, bool getcurpos)
list_append_number(l, list_append_number(l,
(fp != NULL) ? (varnumber_T)fp->coladd : (varnumber_T)0); (fp != NULL) ? (varnumber_T)fp->coladd : (varnumber_T)0);
if (getcurpos) { 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);
} }
} }

View File

@@ -206,7 +206,7 @@ static int included_patches[] = {
//581, //581,
//580, //580,
//579, //579,
//578, 578,
//577, //577,
//576, //576,
//575, //575,