summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2012-04-20 19:47:05 +0200
committerBram Moolenaar <bram@vim.org>2012-04-20 19:47:05 +0200
commit051353c51bad2539e253a4184e4ffd97bd7f5961 (patch)
treea7a9b247c73f68c0016ae855f6f3037ebc325b76
parent2c22a90307dcd9e4bc96f9ae09d294be0bc04b1d (diff)
downloadvim-051353c51bad2539e253a4184e4ffd97bd7f5961.tar.gz
updated for version 7.3.502v7.3.502v7-3-502
Problem: Netbeans insert halfway a line actually appends to the line. Solution: Insert halfway the line. (Brian Victor)
-rw-r--r--src/netbeans.c7
-rw-r--r--src/version.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/netbeans.c b/src/netbeans.c
index e38d8835..d2f4ce4d 100644
--- 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);
}
}
diff --git a/src/version.c b/src/version.c
index 94d429e4..7bce1466 100644
--- 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,