Skip to content
Browse files

Merged from the latest developing branch.

git-svn-id: https://vim.svn.sourceforge.net/svnroot/vim/trunk@1610 2a77ed30-b011-0410-a7ad-c7884a0aa172
  • Loading branch information...
1 parent cce287e commit 1e71a2658ce2082dff4e9c49d660486a577f195a edyfox committed
Showing with 34 additions and 19 deletions.
  1. +12 −9 src/ex_getln.c
  2. +8 −4 src/fold.c
  3. +1 −0 src/structs.h
  4. +2 −1 src/testdir/Make_amiga.mak
  5. +1 −1 src/testdir/Make_dos.mak
  6. +1 −1 src/testdir/Make_ming.mak
  7. +1 −1 src/testdir/Make_os2.mak
  8. +2 −2 src/testdir/Make_vms.mms
  9. +6 −0 src/version.c
View
21 src/ex_getln.c
@@ -3266,7 +3266,6 @@ nextwild(xp, type, options)
int i, j;
char_u *p1;
char_u *p2;
- int oldlen;
int difflen;
int v;
@@ -3291,7 +3290,7 @@ nextwild(xp, type, options)
out_flush();
i = (int)(xp->xp_pattern - ccline.cmdbuff);
- oldlen = ccline.cmdpos - i;
+ xp->xp_pattern_len = ccline.cmdpos - i;
if (type == WILD_NEXT || type == WILD_PREV)
{
@@ -3305,18 +3304,20 @@ nextwild(xp, type, options)
/*
* Translate string into pattern and expand it.
*/
- if ((p1 = addstar(&ccline.cmdbuff[i], oldlen, xp->xp_context)) == NULL)
+ if ((p1 = addstar(xp->xp_pattern, xp->xp_pattern_len,
+ xp->xp_context)) == NULL)
p2 = NULL;
else
{
- p2 = ExpandOne(xp, p1, vim_strnsave(&ccline.cmdbuff[i], oldlen),
+ p2 = ExpandOne(xp, p1,
+ vim_strnsave(&ccline.cmdbuff[i], xp->xp_pattern_len),
WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE
|options, type);
vim_free(p1);
/* longest match: make sure it is not shorter (happens with :help */
if (p2 != NULL && type == WILD_LONGEST)
{
- for (j = 0; j < oldlen; ++j)
+ for (j = 0; j < xp->xp_pattern_len; ++j)
if (ccline.cmdbuff[i + j] == '*'
|| ccline.cmdbuff[i + j] == '?')
break;
@@ -3331,7 +3332,7 @@ nextwild(xp, type, options)
if (p2 != NULL && !got_int)
{
- difflen = (int)STRLEN(p2) - oldlen;
+ difflen = (int)STRLEN(p2) - xp->xp_pattern_len;
if (ccline.cmdlen + difflen > ccline.cmdbufflen - 4)
{
v = realloc_cmdbuff(ccline.cmdlen + difflen);
@@ -3620,6 +3621,7 @@ ExpandInit(xp)
expand_T *xp;
{
xp->xp_pattern = NULL;
+ xp->xp_pattern_len = 0;
xp->xp_backslash = XP_BS_NONE;
#ifndef BACKSLASH_IN_FILENAME
xp->xp_shell = FALSE;
@@ -4311,8 +4313,8 @@ expand_cmdline(xp, str, col, matchcount, matches)
}
/* add star to file name, or convert to regexp if not exp. files. */
- file_str = addstar(xp->xp_pattern,
- (int)(str + col - xp->xp_pattern), xp->xp_context);
+ xp->xp_pattern_len = (int)(str + col - xp->xp_pattern);
+ file_str = addstar(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context);
if (file_str == NULL)
return EXPAND_UNSUCCESSFUL;
@@ -4781,7 +4783,7 @@ call_user_expand_func(user_expand_func, xp, num_file, file)
sprintf((char *)num, "%d", ccline.cmdpos);
args[1] = ccline.cmdbuff;
}
- args[0] = xp->xp_pattern;
+ args[0] = vim_strnsave(xp->xp_pattern, xp->xp_pattern_len);
args[2] = num;
/* Save the cmdline, we don't know what the function may do. */
@@ -4797,6 +4799,7 @@ call_user_expand_func(user_expand_func, xp, num_file, file)
if (ccline.cmdbuff != NULL)
ccline.cmdbuff[ccline.cmdlen] = keep;
+ vim_free(args[0]);
return ret;
}
View
12 src/fold.c
@@ -1607,11 +1607,11 @@ foldMarkAdjustRecurse(gap, line1, line2, amount, amount_after)
}
else
{
- /* 2, 3, or 5: need to correct nested folds too */
- foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top,
- line2 - fp->fd_top, amount, amount_after);
if (fp->fd_top < top)
{
+ /* 2 or 3: need to correct nested folds too */
+ foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top,
+ line2 - fp->fd_top, amount, amount_after);
if (last <= line2)
{
/* 2. fold contains line1, line2 is below fold */
@@ -1628,7 +1628,11 @@ foldMarkAdjustRecurse(gap, line1, line2, amount, amount_after)
}
else
{
- /* 5. fold is below line1 and contains line2 */
+ /* 5. fold is below line1 and contains line2; need to
+ * correct nested folds too */
+ foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top,
+ line2 - fp->fd_top, amount,
+ amount_after + (fp->fd_top - top));
if (amount == MAXLNUM)
{
fp->fd_len -= line2 - fp->fd_top + 1;
View
1 src/structs.h
@@ -432,6 +432,7 @@ typedef struct expand
{
int xp_context; /* type of expansion */
char_u *xp_pattern; /* start of item to expand */
+ int xp_pattern_len; /* bytes in xp_pattern before cursor */
#if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
char_u *xp_arg; /* completion function */
int xp_scriptID; /* SID for completion function */
View
3 src/testdir/Make_amiga.mak
@@ -26,7 +26,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test48.out test51.out test53.out test54.out test55.out \
test56.out test57.out test58.out test59.out test60.out \
test61.out test62.out test63.out test64.out test65.out \
- test66.out
+ test66.out test67.out
.SUFFIXES: .in .out
@@ -112,3 +112,4 @@ test63.out: test63.in
test64.out: test64.in
test65.out: test65.in
test66.out: test66.in
+test67.out: test67.in
View
2 src/testdir/Make_dos.mak
@@ -26,7 +26,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test15.out test17.out test18.out test21.out test26.out \
test30.out test31.out test32.out test33.out test34.out \
test37.out test38.out test39.out test40.out test41.out \
- test42.out test52.out test65.out test66.out
+ test42.out test52.out test65.out test66.out test67.out
SCRIPTS32 = test50.out
View
2 src/testdir/Make_ming.mak
@@ -45,7 +45,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test15.out test17.out test18.out test21.out test26.out \
test30.out test31.out test32.out test33.out test34.out \
test37.out test38.out test39.out test40.out test41.out \
- test42.out test52.out test65.out test66.out
+ test42.out test52.out test65.out test66.out test67.out
SCRIPTS32 = test50.out
View
2 src/testdir/Make_os2.mak
@@ -26,7 +26,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test48.out test51.out test53.out test54.out test55.out \
test56.out test57.out test58.out test59.out test60.out \
test61.out test62.out test63.out test64.out test65.out \
- test66.out
+ test66.out test67.out
.SUFFIXES: .in .out
View
4 src/testdir/Make_vms.mms
@@ -4,7 +4,7 @@
# Authors: Zoltan Arpadffy, <arpadffy@polarhome.com>
# Sandor Kopanyi, <sandor.kopanyi@mailbox.hu>
#
-# Last change: 2009 Mar 05
+# Last change: 2009 Sep 11
#
# This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
# Edit the lines in the Configuration section below to select.
@@ -69,7 +69,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
test48.out test51.out test53.out test54.out test55.out \
test56.out test57.out test60.out \
test61.out test62.out test63.out test64.out test65.out \
- test66.out
+ test66.out test67.out
.IFDEF WANT_GUI
SCRIPT_GUI = test16.out
View
6 src/version.c
@@ -677,6 +677,12 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 262,
+/**/
+ 261,
+/**/
+ 260,
+/**/
259,
/**/
258,

0 comments on commit 1e71a26

Please sign in to comment.
Something went wrong with that request. Please try again.