Mercurial > vim
comparison src/userfunc.c @ 25396:8ecd3575bc8c v8.2.3235
patch 8.2.3235: cannot use lambda in {} block in user command
Commit: https://github.com/vim/vim/commit/6868634abd6a49b2dfd3a994a6da7d5911457a37
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 28 15:54:54 2021 +0200
patch 8.2.3235: cannot use lambda in {} block in user command
Problem: Cannot use lambda in {} block in user command. (Martin Tournoij)
Solution: Do not go over the end of the lambda.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 28 Jul 2021 16:00:05 +0200 |
parents | f03271631eb5 |
children | 5c7192180b89 |
comparison
equal
deleted
inserted
replaced
25395:8312a5e2eef2 | 25396:8ecd3575bc8c |
---|---|
1396 if (ga_grow(&newlines, 1) == FAIL) | 1396 if (ga_grow(&newlines, 1) == FAIL) |
1397 goto errret; | 1397 goto errret; |
1398 | 1398 |
1399 // If there are line breaks, we need to split up the string. | 1399 // If there are line breaks, we need to split up the string. |
1400 line_end = vim_strchr(start, '\n'); | 1400 line_end = vim_strchr(start, '\n'); |
1401 if (line_end == NULL) | 1401 if (line_end == NULL || line_end > end) |
1402 line_end = end; | 1402 line_end = end; |
1403 | 1403 |
1404 // Add "return " before the expression (or the first line). | 1404 // Add "return " before the expression (or the first line). |
1405 len = 7 + (int)(line_end - start) + 1; | 1405 len = 7 + (int)(line_end - start) + 1; |
1406 p = alloc(len); | 1406 p = alloc(len); |