]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.3.502 v7.3.502
authorBram Moolenaar <Bram@vim.org>
Fri, 20 Apr 2012 17:47:05 +0000 (19:47 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 20 Apr 2012 17:47:05 +0000 (19:47 +0200)
Problem:    Netbeans insert halfway a line actually appends to the line.
Solution:   Insert halfway the line. (Brian Victor)

src/netbeans.c
src/version.c

index e38d8835af57e6d2dfe0ab9a60237a571d3ffafa..d2f4ce4dad5cc79ccc9b093bb42448282c9f807a 100644 (file)
@@ -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);
                        }
                    }
index 94d429e4ca10357ccc9edec97bb64966f5169bcf..7bce14667d18b8d985e58ba25f10f1c2371370b7 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    502,
 /**/
     501,
 /**/