diff options
| author | Jurica Bradaric <jbradaric@gmail.com> | 2019-09-23 21:19:26 +0200 | 
|---|---|---|
| committer | Jurica Bradaric <jbradaric@gmail.com> | 2019-10-07 14:14:13 +0200 | 
| commit | 0586a4b512b2495d32f20c46946d35a0d403bd52 (patch) | |
| tree | 6d63e31135bb1e2221e8e528b5dac9498a48a617 /src/nvim/eval.c | |
| parent | c84b39150f3f5e12e042777f61ca9adf13be09d8 (diff) | |
| download | rneovim-0586a4b512b2495d32f20c46946d35a0d403bd52.tar.gz rneovim-0586a4b512b2495d32f20c46946d35a0d403bd52.tar.bz2 rneovim-0586a4b512b2495d32f20c46946d35a0d403bd52.zip | |
vim-patch:8.1.1588: in :let-heredoc line continuation is recognized
Problem:    In :let-heredoc line continuation is recognized.
Solution:   Do not consume line continuation. (Ozaki Kiichi, closes vim/vim#4580)
https://github.com/vim/vim/commit/e96a2498f9a2d3e93ac07431f6d4afd77f30afdf
Diffstat (limited to 'src/nvim/eval.c')
| -rw-r--r-- | src/nvim/eval.c | 13 | 
1 files changed, 8 insertions, 5 deletions
| diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 6d706939a1..c18d687cc1 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -1561,7 +1561,7 @@ heredoc_get(exarg_T *eap, char_u *cmd)    for (;;) {      int i = 0; -    char_u *theline = eap->getline(NUL, eap->cookie, 0); +    char_u *theline = eap->getline(NUL, eap->cookie, 0, false);      if (theline != NULL && indent_len > 0) {        // trim the indent matching the first line        if (STRNCMP(theline, *eap->cmdlinep, indent_len) == 0) { @@ -8734,7 +8734,7 @@ typedef struct {    const listitem_T *li;  } GetListLineCookie; -static char_u *get_list_line(int c, void *cookie, int indent) +static char_u *get_list_line(int c, void *cookie, int indent, bool do_concat)  {    GetListLineCookie *const p = (GetListLineCookie *)cookie; @@ -21279,6 +21279,7 @@ void ex_function(exarg_T *eap)    hashitem_T  *hi;    int sourcing_lnum_off;    bool show_block = false; +  bool do_concat = true;    /*     * ":function" without argument: list functions. @@ -21548,9 +21549,9 @@ void ex_function(exarg_T *eap)      } else {        xfree(line_to_free);        if (eap->getline == NULL) { -        theline = getcmdline(':', 0L, indent); +        theline = getcmdline(':', 0L, indent, do_concat);        } else { -        theline = eap->getline(':', eap->cookie, indent); +        theline = eap->getline(':', eap->cookie, indent, do_concat);        }        line_to_free = theline;      } @@ -21580,6 +21581,7 @@ void ex_function(exarg_T *eap)          if (STRCMP(p, skip_until) == 0) {            XFREE_CLEAR(skip_until);            XFREE_CLEAR(trimmed); +          do_concat = true;          }        }      } else { @@ -21699,6 +21701,7 @@ void ex_function(exarg_T *eap)          } else {            skip_until = vim_strnsave(p, (int)(skiptowhite(p) - p));          } +        do_concat = false;        }      } @@ -23522,7 +23525,7 @@ char_u *get_return_cmd(void *rettv)   * Called by do_cmdline() to get the next line.   * Returns allocated string, or NULL for end of function.   */ -char_u *get_func_line(int c, void *cookie, int indent) +char_u *get_func_line(int c, void *cookie, int indent, bool do_concat)  {    funccall_T  *fcp = (funccall_T *)cookie;    ufunc_T     *fp = fcp->func; | 
