From 866788616ad6fd63a016a56465764df036f84c16 Mon Sep 17 00:00:00 2001 From: edyfox Date: Fri, 9 Mar 2007 00:44:06 +0000 Subject: [PATCH] Patch 7.0.209 Problem: When replacing a line through Python the cursor may end up beyond the end of the line. Solution: Check the cursor column after replacing the line. Files: src/if_python.c git-svn-id: https://vim.svn.sourceforge.net/svnroot/vim/vim7@227 2a77ed30-b011-0410-a7ad-c7884a0aa172 --- src/if_python.c | 6 ++++++ src/version.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/if_python.c b/src/if_python.c index adcb52d2..0e06d36e 100644 --- a/src/if_python.c +++ b/src/if_python.c @@ -2410,6 +2410,8 @@ py_fix_cursor(int lo, int hi, int extra) curwin->w_cursor.lnum = lo; check_cursor(); } + else + check_cursor_col(); changed_cline_bef_curs(); } invalidate_botline(); @@ -2487,6 +2489,10 @@ SetBufferLine(buf_T *buf, int n, PyObject *line, int *len_change) curbuf = savebuf; + /* Check that the cursor is not beyond the end of the line now. */ + if (buf == curwin->w_buffer) + check_cursor_col(); + if (PyErr_Occurred() || VimErrorCheck()) return FAIL; diff --git a/src/version.c b/src/version.c index 331e75ff..77f71c87 100644 --- a/src/version.c +++ b/src/version.c @@ -667,6 +667,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 209, +/**/ 208, /**/ 207, -- 2.11.4.GIT