diff src/edit.c @ 1073:ec7a570696ac v7.0.199

updated for version 7.0-199
author vimboss
date Tue, 20 Feb 2007 02:31:20 +0000
parents d763e7d7e938
children a112fdce9ebd
line wrap: on
line diff
--- a/src/edit.c
+++ b/src/edit.c
@@ -3448,11 +3448,16 @@ ins_compl_prep(c)
 	    }
 	    else
 	    {
+		int prev_col = curwin->w_cursor.col;
+
 		/* put the cursor on the last char, for 'tw' formatting */
-		curwin->w_cursor.col--;
+		if (prev_col > 0)
+		    dec_cursor();
 		if (stop_arrow() == OK)
 		    insertchar(NUL, 0, -1);
-		curwin->w_cursor.col++;
+		if (prev_col > 0
+			     && ml_get_curline()[curwin->w_cursor.col] != NUL)
+		    inc_cursor();
 	    }
 
 	    auto_format(FALSE, TRUE);