changeset 1971:11c6bda3b53a v7.2.268

updated for version 7.2-268
author vimboss
date Tue, 03 Nov 2009 10:43:27 +0000
parents 7bcd81b96e2a
children 82f866f19e91
files src/if_python.c src/version.c
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/if_python.c
+++ b/src/if_python.c
@@ -2058,6 +2058,7 @@ WindowSetattr(PyObject *self, char *name
     {
 	long lnum;
 	long col;
+	long len;
 
 	if (!PyArg_Parse(val, "(ll)", &lnum, &col))
 	    return -1;
@@ -2072,10 +2073,16 @@ WindowSetattr(PyObject *self, char *name
 	if (VimErrorCheck())
 	    return -1;
 
-	/* NO CHECK ON COLUMN - SEEMS NOT TO MATTER */
+	/* When column is out of range silently correct it. */
+	len = STRLEN(ml_get_buf(this->win->w_buffer, lnum, FALSE));
+	if (col > len)
+	    col = len;
 
 	this->win->w_cursor.lnum = lnum;
 	this->win->w_cursor.col = col;
+#ifdef FEAT_VIRTUALEDIT
+	this->win->w_cursor.coladd = 0;
+#endif
 	update_screen(VALID);
 
 	return 0;
--- a/src/version.c
+++ b/src/version.c
@@ -677,6 +677,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    268,
+/**/
     267,
 /**/
     266,