diff src/if_py_both.h @ 2933:0bef86c5c985 v7.3.239

updated for version 7.3.239 Problem: Python corrects the cursor column without taking 'virtualedit' into account. (lilydjwg) Solution: Call check_cursor_col_win().
author Bram Moolenaar <bram@vim.org>
date Thu, 07 Jul 2011 15:08:58 +0200
parents b67d3a44262a
children 2665b456ee59
line wrap: on
line diff
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -534,7 +534,6 @@ WindowSetattr(PyObject *self, char *name
     {
 	long lnum;
 	long col;
-	long len;
 
 	if (!PyArg_Parse(val, "(ll)", &lnum, &col))
 	    return -1;
@@ -549,18 +548,15 @@ WindowSetattr(PyObject *self, char *name
 	if (VimErrorCheck())
 	    return -1;
 
-	/* When column is out of range silently correct it. */
-	len = (long)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
+	/* When column is out of range silently correct it. */
+	check_cursor_col_win(this->win);
+
 	update_screen(VALID);
-
 	return 0;
     }
     else if (strcmp(name, "height") == 0)