diff options
author | Bram Moolenaar <Bram@vim.org> | 2011-07-07 15:08:58 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2011-07-07 15:08:58 +0200 |
commit | 03a807aaf45e5f85a10cd3b0c4e4913d170f8f5a (patch) | |
tree | 2a1889c39ffc1fcb52dd2950e9327fec7ee01648 /src/if_py_both.h | |
parent | 5cfe2d760db119718287ad3d4ee11d6914ceee58 (diff) | |
download | vim-git-03a807aaf45e5f85a10cd3b0c4e4913d170f8f5a.tar.gz |
updated for version 7.3.239v7.3.239
Problem: Python corrects the cursor column without taking 'virtualedit'
into account. (lilydjwg)
Solution: Call check_cursor_col_win().
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) |