0
0
mirror of https://github.com/vim/vim.git synced 2025-10-01 04:54:07 -04:00

patch 8.2.3228: cannot use a simple block for the :command argument

Problem:    Cannot use a simple block for the :command argument. (Maarten
            Tournoij)
Solution:   Recognize a simple {} block. (issue #8623)
This commit is contained in:
Bram Moolenaar
2021-07-27 21:17:32 +02:00
parent 53ba05b090
commit 5d7c2df536
6 changed files with 84 additions and 14 deletions

View File

@@ -1488,7 +1488,6 @@ ga_grow_inner(garray_T *gap, int n)
return OK;
}
#if defined(FEAT_EVAL) || defined(FEAT_SEARCHPATH) || defined(PROTO)
/*
* For a growing array that contains a list of strings: concatenate all the
* strings with a separating "sep".
@@ -1524,27 +1523,27 @@ ga_concat_strings(garray_T *gap, char *sep)
}
return s;
}
#endif
#if defined(FEAT_VIMINFO) || defined(FEAT_EVAL) || defined(PROTO)
/*
* Make a copy of string "p" and add it to "gap".
* When out of memory nothing changes.
* When out of memory nothing changes and FAIL is returned.
*/
void
int
ga_add_string(garray_T *gap, char_u *p)
{
char_u *cp = vim_strsave(p);
if (cp != NULL)
if (cp == NULL)
return FAIL;
if (ga_grow(gap, 1) == FAIL)
{
if (ga_grow(gap, 1) == OK)
((char_u **)(gap->ga_data))[gap->ga_len++] = cp;
else
vim_free(cp);
vim_free(cp);
return FAIL;
}
((char_u **)(gap->ga_data))[gap->ga_len++] = cp;
return OK;
}
#endif
/*
* Concatenate a string to a growarray which contains bytes.