diff options
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r-- | src/if_py_both.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h index 07eedb5f3..c7870bc10 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -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) |