Mercurial > vim
comparison src/evalvars.c @ 25405:747ebbce2421 v8.2.3239
patch 8.2.3239: Vim9: no error using heredoc for a number variable
Commit: https://github.com/vim/vim/commit/81530e36033dec2c2cd94af6dd48ceb0389e95a2
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 28 21:25:49 2021 +0200
patch 8.2.3239: Vim9: no error using heredoc for a number variable
Problem: Vim9: no error using heredoc for a number variable.
Solution: Add a type check. (closes https://github.com/vim/vim/issues/8627)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 28 Jul 2021 21:30:04 +0200 |
parents | f03271631eb5 |
children | 2063b858cad9 |
comparison
equal
deleted
inserted
replaced
25404:d713f6697450 | 25405:747ebbce2421 |
---|---|
815 eap->nextcmd = check_nextcmd(arg); | 815 eap->nextcmd = check_nextcmd(arg); |
816 } | 816 } |
817 else if (expr[0] == '=' && expr[1] == '<' && expr[2] == '<') | 817 else if (expr[0] == '=' && expr[1] == '<' && expr[2] == '<') |
818 { | 818 { |
819 list_T *l; | 819 list_T *l; |
820 long cur_lnum = SOURCING_LNUM; | |
820 | 821 |
821 // HERE document | 822 // HERE document |
822 l = heredoc_get(eap, expr + 3, FALSE); | 823 l = heredoc_get(eap, expr + 3, FALSE); |
823 if (l != NULL) | 824 if (l != NULL) |
824 { | 825 { |
825 rettv_list_set(&rettv, l); | 826 rettv_list_set(&rettv, l); |
826 if (!eap->skip) | 827 if (!eap->skip) |
827 { | 828 { |
829 // errors are for the assignment, not the end marker | |
830 SOURCING_LNUM = cur_lnum; | |
828 op[0] = '='; | 831 op[0] = '='; |
829 op[1] = NUL; | 832 op[1] = NUL; |
830 (void)ex_let_vars(eap->arg, &rettv, FALSE, semicolon, var_count, | 833 (void)ex_let_vars(eap->arg, &rettv, FALSE, semicolon, var_count, |
831 flags, op); | 834 flags, op); |
832 } | 835 } |