aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/userfunc.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-14 20:35:46 +0800
committerGitHub <noreply@github.com>2023-04-14 20:35:46 +0800
commite36806666fe3c5792c39f0f9127e6637a6ceb7f2 (patch)
tree32c663b2e5892aa7095d6718a21a3eb37e810850 /src/nvim/eval/userfunc.c
parent789654accd590318a56a115cd086441893e4473a (diff)
downloadrneovim-e36806666fe3c5792c39f0f9127e6637a6ceb7f2.tar.gz
rneovim-e36806666fe3c5792c39f0f9127e6637a6ceb7f2.tar.bz2
rneovim-e36806666fe3c5792c39f0f9127e6637a6ceb7f2.zip
vim-patch:8.2.2138: Vim9: "exit_cb" causes Vim to exit (#23087)
Problem: Vim9: "exit_cb" causes Vim to exit. Solution: Require white space after a command in Vim9 script. (closes vim/vim#7467) Also fix that Vim9 style heredoc was not always recognized. https://github.com/vim/vim/commit/b5b9480ee936ef4cd0e350c468ef8c5f42fa398b Omit EX_NONWHITE_OK, E1143, E1144: Vim9 script only. Cherry-pick test_vimscript.vim changes from patch 8.2.2141. Cherry-pick E1145 tag from Vim runtime. N/A patches for version.c: vim-patch:8.2.2140: build failure with tiny features Problem: Build failure with tiny features. Solution: Add #ifdef. https://github.com/vim/vim/commit/2a3cd3af455973d678f70303ebdd486f3478bc0d Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/eval/userfunc.c')
-rw-r--r--src/nvim/eval/userfunc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c
index f73d22243d..178f9fd6b6 100644
--- a/src/nvim/eval/userfunc.c
+++ b/src/nvim/eval/userfunc.c
@@ -71,6 +71,8 @@ static const char *e_funcref = N_("E718: Funcref required");
static const char *e_nofunc = N_("E130: Unknown function: %s");
static const char e_no_white_space_allowed_before_str_str[]
= N_("E1068: No white space allowed before '%s': %s");
+static const char e_missing_heredoc_end_marker_str[]
+ = N_("E1145: Missing heredoc end marker: %s");
void func_init(void)
{
@@ -2319,7 +2321,11 @@ void ex_function(exarg_T *eap)
lines_left = Rows - 1;
}
if (theline == NULL) {
- emsg(_("E126: Missing :endfunction"));
+ if (skip_until != NULL) {
+ semsg(_(e_missing_heredoc_end_marker_str), skip_until);
+ } else {
+ emsg(_("E126: Missing :endfunction"));
+ }
goto erret;
}
if (show_block) {