From 0dd1ad0760ecdbfeef94da4ef33d71e66eab35b3 Mon Sep 17 00:00:00 2001 From: oni-link Date: Wed, 4 Mar 2015 17:57:47 +0100 Subject: 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 --- src/nvim/eval.c | 4 +++- src/nvim/version.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 87bd058c9e..9b4b4ce496 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -9479,7 +9479,9 @@ static void getpos_both(typval_T *argvars, typval_T *rettv, bool getcurpos) list_append_number(l, (fp != NULL) ? (varnumber_T)fp->coladd : (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); } } diff --git a/src/nvim/version.c b/src/nvim/version.c index 8abbdb8a8b..8357de9f46 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -206,7 +206,7 @@ static int included_patches[] = { //581, //580, //579, - //578, + 578, //577, //576, //575, -- cgit