diff src/edit.c @ 6363:e6c5ff35500d v7.4.514

updated for version 7.4.514 Problem: Memory access error. (Dominique Pelle) Solution: Update tpos. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Wed, 12 Nov 2014 18:59:25 +0100
parents 5e998fc610d5
children 5b8d26b85437
line wrap: on
line diff
--- a/src/edit.c
+++ b/src/edit.c
@@ -6918,6 +6918,8 @@ stop_insert(end_insert_pos, esc, nomove)
 		curwin->w_cursor = tpos;
 	    else
 	    {
+		/* reset tpos, could have been invalidated in the loop above */
+		tpos = curwin->w_cursor;
 		tpos.col++;
 		if (cc != NUL && gchar_pos(&tpos) == NUL)
 		    ++curwin->w_cursor.col;	/* put cursor back on the NUL */