changeset 3476:1d1cce57421c v7.3.502

updated for version 7.3.502 Problem: Netbeans insert halfway a line actually appends to the line. Solution: Insert halfway the line. (Brian Victor)
author Bram Moolenaar <bram@vim.org>
date Fri, 20 Apr 2012 19:47:05 +0200
parents c745200097dc
children 04c692d60494
files src/netbeans.c src/version.c
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -1812,14 +1812,15 @@ nb_do_cmd(
 			char_u *oldline = ml_get(lnum);
 			char_u *newline;
 
-			/* Insert halfway a line.  For simplicity we assume we
-			 * need to append to the line. */
+			/* Insert halfway a line. */
 			newline = alloc_check(
 				       (unsigned)(STRLEN(oldline) + len + 1));
 			if (newline != NULL)
 			{
-			    STRCPY(newline, oldline);
+			    mch_memmove(newline, oldline, (size_t)pos->col);
+			    newline[pos->col] = NUL;
 			    STRCAT(newline, args);
+			    STRCAT(newline, oldline + pos->col);
 			    ml_replace(lnum, newline, FALSE);
 			}
 		    }
--- a/src/version.c
+++ b/src/version.c
@@ -715,6 +715,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    502,
+/**/
     501,
 /**/
     500,