summaryrefslogtreecommitdiff
path: root/src/netbeans.c
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
commite436528e04cd2b5bac71ec2dcef815255a5fcc8b (patch)
treeb7cb5258cab7298ad2f48a405c14e1921ec984f0 /src/netbeans.c
parent35df7d2d99823124e0001e023ff1e2764cfb5937 (diff)
downloadvim-git-e436528e04cd2b5bac71ec2dcef815255a5fcc8b.tar.gz
updated for version 7.3.502v7.3.502
Problem: Netbeans insert halfway a line actually appends to the line. Solution: Insert halfway the line. (Brian Victor)
Diffstat (limited to 'src/netbeans.c')
-rw-r--r--src/netbeans.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/netbeans.c b/src/netbeans.c
index e38d8835a..d2f4ce4da 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);
}
}