| Commit message (Collapse) | Author | Age |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#32317)
Problem: Strange error when heredoc marker starts with "trim".
Solution: Check for whitespace after "trim" or "eval" (zeertzjq)
For :python3 etc., a heredoc marker that starts with a lower-case letter
is valid, and when it starts with "trim" it works in a script but not in
a function, and this PR makes it works in a function.
For :let, a heredoc marker that starts with a lower-case letter is not
valid, but when it starts with "trim" or "eval" the error can be a bit
confusing in a function, and this PR make it less confusing.
closes: vim/vim#16574
https://github.com/vim/vim/commit/449c2e5454735fe1cfc8c21b2c6880d6bdf4cd6e
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: "clear" macros are not always used.
Solution: Use ALLOC_ONE, VIM_CLEAR, CLEAR_POINTER and CLEAR_FIELD in more
places. (Yegappan Lakshmanan, closes vim/vim#12104)
https://github.com/vim/vim/commit/960dcbd098c761dd623bec9492d5391ff6e8dceb
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Cannot use Perl heredoc in nested :def function. (Virginia
Senioria)
Solution: Only concatenate heredoc lines when not in a nested function.
(closes vim/vim#10415)
https://github.com/vim/vim/commit/d881d1598467d88808bafd2fa86982ebbca7dcc1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Arguments of a function are missing after failing to redefine
it (after 8.2.2505), and heap-use-after-free with script-local
function (after 9.1.1063).
Solution: Don't clear arguments or free uf_name_exp when failing to
redefine an existing function (zeertzjq)
closes: vim/vim#16567
https://github.com/vim/vim/commit/04d2a3fdc051d6a419dc0ea4de7a9640cefccd31
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
:14verbose
Problem: heap-use-after-free and stack-use-after-scope with :14verbose
when using :return and :try (after 9.1.1063).
Solution: Move back the vim_free(tofree) and the scope of numbuf[].
(zeertzjq)
closes: vim/vim#16563
https://github.com/vim/vim/commit/2101230f4013860dbafcb0cab3f4e6bc92fb6f35
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: too many strlen() calls in userfunc.c
Solution: refactor userfunc.c and remove calls to strlen(),
drop set_ufunc_name() and roll it into alloc_ufunc(),
check for out-of-memory condition in trans_function_name_ext()
(John Marriott)
closes: vim/vim#16537
https://github.com/vim/vim/commit/b32800f7c51c866dc0e87244eb4902540982309d
Add missing change to call_user_func() from patch 8.1.1007.
Consistently use PRIdSCID instead of PRId64 for script IDs.
Co-authored-by: John Marriott <basilisk@internode.on.net>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Crash and/or memory leak when redefining function after error.
Solution: Clear pointer after making a copy. Clear arrays on failure.
(closes vim/vim#11774)
https://github.com/vim/vim/commit/f057171d8b562c72334fd7c15c89ff787358ce3a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Vim9: crash after defining function with invalid return type.
Solution: Clear function growarrays. Fix memory leak.
https://github.com/vim/vim/commit/31842cd0772b557eb9584a13740430db29de8a51
Cherry-pick free_fp from patch 8.2.3812.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Vim9: function expanded name is cleared when sourcing a script
again.
Solution: Only clear the expanded name when deleting the function.
(closes vim/vim#6707)
https://github.com/vim/vim/commit/c4ce36d48698669f81ec90f7c9dc9ab8c362e538
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: def_function() may return pointer that was freed.
Solution: Set "fp" to NULL after freeing it.
https://github.com/vim/vim/commit/a14e6975478adeddcc2161edc1ec611016aa89f3
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Port one_function_arg() and get_function_body() from Vim.
vim-patch:8.2.2865: skipping over function body fails
Problem: Skipping over function body fails.
Solution: Do not define the function when skipping.
https://github.com/vim/vim/commit/d87c21a918d8d611750f22d68fc638bf7a79b1d5
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Vim9: Regression caused by patch v9.1.0646
Solution: Translate the function name before invoking it in call()
(Yegappan Lakshmanan)
fixes: vim/vim#16430
closes: vim/vim#16445
https://github.com/vim/vim/commit/6289f9159102e0855bedc566636b5e7ca6ced72c
N/A patch:
vim-patch:8.2.4176: Vim9: cannot use imported function with call()
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In the api_info() output:
:new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val')
...
{'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1}
The `ArrayOf(Integer, 2)` return type didn't break clients when we added
it, which is evidence that clients don't use the `return_type` field,
thus renaming Dictionary => Dict in api_info() is not (in practice)
a breaking change.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Wrong comment for "len" argument of call_simple_func().
Solution: Remove the "or -1 to use strlen()". Also change its type to
size_t to remove one cast. (zeertzjq)
closes: vim/vim#15410
https://github.com/vim/vim/commit/c1ed788c1b41db9b5f1ef548dc877f771f535bbe
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Calling a function from an "expr" option has too much overhead.
Solution: Add call_simple_func() and use it for 'foldexpr'
https://github.com/vim/vim/commit/87b4e5c5db9d1cfd6f2e79656e1a6cff3c69d15f
Cherry-pick a call_func() change from patch 8.2.1343.
Add expr-option-function docs to options.txt.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#29950)
Problem: Vim9: using a script-local function requires using "s:" when
setting 'completefunc'.
Solution: Do not require "s:" in Vim9 script. (closes vim/vim#9796)
https://github.com/vim/vim/commit/1fca5f3e86f08e696058fc7e86dfe41b415a78e6
vim-patch:8.2.4417: using NULL pointer
Problem: Using NULL pointer.
Solution: Set offset after checking for NULL pointer.
https://github.com/vim/vim/commit/e89bfd212b21c227f026e467f882c62cdd6e642d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: No way to get the arity of a Vim function
(Austin Ziegler)
Solution: Enhance get() Vim script function to return the function
argument info using get(func, "arity") (LemonBoy)
fixes: vim/vim#15097
closes: vim/vim#15109
https://github.com/vim/vim/commit/48b7d05a4f88c4326bd5d7a73a523f2d953b3e51
Co-authored-by: LemonBoy <thatlemon@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The latter was mostly relevant with the past char_u madness.
NOTE: STRCAT also functioned as a counterfeit "NOLINT" for clint
apparently. But NOLINT-ing every usecase is just the same as disabling
the check entirely.
|
| | |
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: Famiu Haque <famiuhaque@proton.me>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Guilherme Soares <guilhermesoares1970@gmail.com>
Co-authored-by: Jannik Buhr <jannik.m.buhr@gmail.com>
Co-authored-by: thomaswuhoileong <72001875+thomaswuhoileong@users.noreply.github.com>
Co-authored-by: tom-anders <13141438+tom-anders@users.noreply.github.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
| |
| |
| |
| |
| |
| | |
Problem: Using xstrlcpy() when the exact length of the string to be
copied is known is not ideal because it requires adding 1 to
the length and an unnecessary strlen().
Solution: Add xmemcpyz() and use it in place of such xstrlcpy() calls.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: POSIX function name in exarg struct causes issues
on OpenVMS
Solution: Rename getline member in exarg struct to ea_getline,
remove isinf() workaround for VMS
There are compilers that do not treat well POSIX functions - like
getline - usage in the structs.
Older VMS compilers could digest this... but the newer OpenVMS compilers
( like VSI C x86-64 X7.4-843 (GEM 50XB9) ) cannot deal with these
structs. This could be limited to getline() that is defined via
getdelim() and might not affect all POSIX functions in general - but
avoiding POSIX function names usage in the structs is a "safe side"
practice without compromising the functionality or the code readability.
The previous OpenVMS X86 port used a workaround limiting the compiler
capabilities using __CRTL_VER_OVERRIDE=80400000
In order to make the OpenVMS port future proof, this pull request
proposes a possible solution.
closes: vim/vim#13704
https://github.com/vim/vim/commit/6fdb6280821a822768df5689a5d727e37d38306c
Co-authored-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Vim9: heredoc start may be recognized in string.
Solution: Don't skip to closing bracket for invalid list assignment.
(zeertzjq)
closes: vim/vim#14472
https://github.com/vim/vim/commit/1817ccdb107ceeaf5c48fe193da5146682c15ca6
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Vim9: comment may be treated as heredoc start.
(Ernie Rael)
Solution: Use skip_var_list() instead of find_name_end().
(zeertzjq)
fixes: vim/vim#14444
closes: vim/vim#14446
https://github.com/vim/vim/commit/9a91d2b72c20f213bbf77f27b7edd01e0e43d5e0
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
'formatexpr' (#27883)
Problem: Can define function with invalid name inside 'formatexpr'.
Solution: Use goto instead of checking for did_emsg later.
(zeertzjq)
closes: vim/vim#14209
https://github.com/vim/vim/commit/6a04bf5ee523b2d6d01d7290e356a30de219f465
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#27881)
Problem: Vim9: no error if a function shadows a script variable.
Solution: Check the function doesn't shadow a variable. (closes vim/vim#9310)
https://github.com/vim/vim/commit/052ff291d72bc9c176f9562f021d7e8e030e74c0
Omit EVAL_VAR_NO_FUNC: Vim9 script only.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|\ \
| |/
|/| |
|
| | |
|
| |\ |
|
| |\ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
A user function can clobber the repeat_cmdline, which is used to build
the redo buffer, thus, if the redo buffer is saved when calling a
userfunc, so should the repeat_cmdline.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Remove `export` pramgas from defs headers as it causes IWYU to believe
that the definitions from the defs headers comes from main header, which
is not what we really want.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Specifically, specify that each initialization should be done on a
separate line.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Problem: Set_ref_in_list() only sets ref in items.
Solution: Rename to set_ref_in_list_items() to avoid confusion.
https://github.com/vim/vim/commit/7be3ab25891fec711d8a2d9d242711a9155852b6
Omit set_ref_in_list() and set_ref_in_dict(): only used in popup window,
if_pyth and if_lua.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |_|/
|/| |
| | |
| | |
| | |
| | | |
FUNC_ATTR_* should only be used in .c files with generated headers.
Defining FUNC_ATTR_* as empty in headers causes misuses of them to be
silently ignored. Instead don't define them by default, and only define
them as empty after a .c file has included its generated header.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|