summaryrefslogtreecommitdiff
path: root/src/userfunc.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-07-28 15:54:54 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-28 15:54:54 +0200
commit6868634abd6a49b2dfd3a994a6da7d5911457a37 (patch)
tree52f0c0f90a6cc39aa916cf2817201b739b47fb28 /src/userfunc.c
parent78e006b9b02fac94c910445d842f6dc5331fa57a (diff)
downloadvim-git-6868634abd6a49b2dfd3a994a6da7d5911457a37.tar.gz
patch 8.2.3235: cannot use lambda in {} block in user commandv8.2.3235
Problem: Cannot use lambda in {} block in user command. (Martin Tournoij) Solution: Do not go over the end of the lambda.
Diffstat (limited to 'src/userfunc.c')
-rw-r--r--src/userfunc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index 7c9634742..e00871883 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -1398,7 +1398,7 @@ get_lambda_tv(
// If there are line breaks, we need to split up the string.
line_end = vim_strchr(start, '\n');
- if (line_end == NULL)
+ if (line_end == NULL || line_end > end)
line_end = end;
// Add "return " before the expression (or the first line).