Mercurial > vim
comparison src/misc2.c @ 25382:b80e4e9c4988 v8.2.3228
patch 8.2.3228: cannot use a simple block for the :command argument
Commit: https://github.com/vim/vim/commit/5d7c2df536c17db4a9c61e0760bdcf78d0db7330
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jul 27 21:17:32 2021 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 27 Jul 2021 21:30:08 +0200 |
parents | ac88cd21ae88 |
children | 02d1b2817585 |
comparison
equal
deleted
inserted
replaced
25381:d5abf60e9872 | 25382:b80e4e9c4988 |
---|---|
1486 gap->ga_maxlen = gap->ga_len + n; | 1486 gap->ga_maxlen = gap->ga_len + n; |
1487 gap->ga_data = pp; | 1487 gap->ga_data = pp; |
1488 return OK; | 1488 return OK; |
1489 } | 1489 } |
1490 | 1490 |
1491 #if defined(FEAT_EVAL) || defined(FEAT_SEARCHPATH) || defined(PROTO) | |
1492 /* | 1491 /* |
1493 * For a growing array that contains a list of strings: concatenate all the | 1492 * For a growing array that contains a list of strings: concatenate all the |
1494 * strings with a separating "sep". | 1493 * strings with a separating "sep". |
1495 * Returns NULL when out of memory. | 1494 * Returns NULL when out of memory. |
1496 */ | 1495 */ |
1522 p += STRLEN(p); | 1521 p += STRLEN(p); |
1523 } | 1522 } |
1524 } | 1523 } |
1525 return s; | 1524 return s; |
1526 } | 1525 } |
1527 #endif | 1526 |
1528 | |
1529 #if defined(FEAT_VIMINFO) || defined(FEAT_EVAL) || defined(PROTO) | |
1530 /* | 1527 /* |
1531 * Make a copy of string "p" and add it to "gap". | 1528 * Make a copy of string "p" and add it to "gap". |
1532 * When out of memory nothing changes. | 1529 * When out of memory nothing changes and FAIL is returned. |
1533 */ | 1530 */ |
1534 void | 1531 int |
1535 ga_add_string(garray_T *gap, char_u *p) | 1532 ga_add_string(garray_T *gap, char_u *p) |
1536 { | 1533 { |
1537 char_u *cp = vim_strsave(p); | 1534 char_u *cp = vim_strsave(p); |
1538 | 1535 |
1539 if (cp != NULL) | 1536 if (cp == NULL) |
1540 { | 1537 return FAIL; |
1541 if (ga_grow(gap, 1) == OK) | 1538 |
1542 ((char_u **)(gap->ga_data))[gap->ga_len++] = cp; | 1539 if (ga_grow(gap, 1) == FAIL) |
1543 else | 1540 { |
1544 vim_free(cp); | 1541 vim_free(cp); |
1545 } | 1542 return FAIL; |
1546 } | 1543 } |
1547 #endif | 1544 ((char_u **)(gap->ga_data))[gap->ga_len++] = cp; |
1545 return OK; | |
1546 } | |
1548 | 1547 |
1549 /* | 1548 /* |
1550 * Concatenate a string to a growarray which contains bytes. | 1549 * Concatenate a string to a growarray which contains bytes. |
1551 * When "s" is NULL does not do anything. | 1550 * When "s" is NULL does not do anything. |
1552 * Note: Does NOT copy the NUL at the end! | 1551 * Note: Does NOT copy the NUL at the end! |