diff src/edit.c @ 8003:94798af62c56 v7.4.1296

commit https://github.com/vim/vim/commit/f068dcafcfe0c8018e5a559c50769ca1364bd9a5 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 9 21:24:46 2016 +0100 patch 7.4.1296 Problem: Cursor changes column with up motion when the matchparen plugin saves and restores the cursor position. (Martin Kunev) Solution: Make sure curswant is updated before invoking the autocommand.
author Christian Brabandt <cb@256bit.org>
date Tue, 09 Feb 2016 21:30:06 +0100
parents 83861277e6a3
children 54cfe888c627
line wrap: on
line diff
--- a/src/edit.c
+++ b/src/edit.c
@@ -1611,7 +1611,12 @@ ins_redraw(
 # endif
 # ifdef FEAT_AUTOCMD
 	if (has_cursormovedI())
+	{
+	    /* Make sure curswant is correct, an autocommand may call
+	     * getcurpos(). */
+	    update_curswant();
 	    apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf);
+	}
 # endif
 # ifdef FEAT_CONCEAL
 	if (curwin->w_p_cole > 0)