mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
updated for version 7.3.239
Problem: Python corrects the cursor column without taking 'virtualedit' into account. (lilydjwg) Solution: Call check_cursor_col_win().
This commit is contained in:
@@ -534,7 +534,6 @@ WindowSetattr(PyObject *self, char *name, PyObject *val)
|
||||
{
|
||||
long lnum;
|
||||
long col;
|
||||
long len;
|
||||
|
||||
if (!PyArg_Parse(val, "(ll)", &lnum, &col))
|
||||
return -1;
|
||||
@@ -549,18 +548,15 @@ WindowSetattr(PyObject *self, char *name, PyObject *val)
|
||||
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
|
||||
update_screen(VALID);
|
||||
/* 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)
|
||||
|
Reference in New Issue
Block a user