summaryrefslogtreecommitdiff
path: root/src/structs.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-20 15:02:42 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-20 15:02:42 +0200
commit66250c932e8a0e3c43e7c7c7b1dbede040b9c508 (patch)
tree485324d99b96692841c3f44ad0f76b4c67be4d49 /src/structs.h
parent93ad14710bdf77591f927a2b244bba6a8cbc7706 (diff)
downloadvim-git-66250c932e8a0e3c43e7c7c7b1dbede040b9c508.tar.gz
patch 8.2.1491: Vim9: crash when compiling heredoc lines start with commentv8.2.1491
Problem: Vim9: crash when compiling heredoc lines start with comment. Solution: Skip over NULL pointers. Do not remove comment and empty lines when fetching function lines. (closes #6743)
Diffstat (limited to 'src/structs.h')
-rw-r--r--src/structs.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/structs.h b/src/structs.h
index c94fa94e2..d8545112b 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1761,6 +1761,13 @@ typedef struct
# endif
} scriptitem_T;
+// type of getline() last argument
+typedef enum {
+ GETLINE_NONE, // do not concatenate any lines
+ GETLINE_CONCAT_CONT, // concatenate continuation lines
+ GETLINE_CONCAT_ALL // concatenate continuation and Vim9 # comment lines
+} getline_opt_T;
+
// Struct passed through eval() functions.
// See EVALARG_EVALUATE for a fixed value with eval_flags set to EVAL_EVALUATE.
typedef struct {
@@ -1768,7 +1775,7 @@ typedef struct {
int eval_break_count; // nr of line breaks consumed
// copied from exarg_T when "getline" is "getsourceline". Can be NULL.
- char_u *(*eval_getline)(int, void *, int, int);
+ char_u *(*eval_getline)(int, void *, int, getline_opt_T);
void *eval_cookie; // argument for eval_getline()
// used when compiling a :def function, NULL otherwise