vim.iter wraps a table or iterator function into an `Iter` object with
methods such as `filter`, `map`, and `fold` which can be chained to
produce iterator pipelines that do not create new tables at each step.
- vim.diagnostic.config() now accepts a function for the virtual_text.prefix
option, which allows for rendering e.g., diagnostic severities differently.
Problem: The :defer command does not check the function argument count and
types.
Solution: Check the function arguments when adding a deferred function.
169003289f
Cherry-pick check_internal_func() from Vim, but use EvalFuncDef pointer
as first argument.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Deferred functions not invoked when partial func exits.
Solution: Create a funccall_T when calling a :def function.
9667b2c888
The remove_funccal() function is currently unused, but it will be used
in patch 9.0.0618.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Invalid memory access with bad 'statusline' value.
Solution: Avoid going over the NUL at the end.
7b17eb4b06
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Invalid memory access with recursive substitute expression.
Solution: Check the return value of vim_regsub().
3ac1d97a1d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: exception in ISN_INSTR caught at wrong level.
Solution: Set the starting trylevel in exec_instructions(). (closesvim/vim#8214)
ff65288aa8
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Invalid memory access in substitute with function that goes to
another file.
Solution: Check for text locked in CTRL-W gf.
cc762a48d4
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: C++ 20 modules are not recognized.
Solution: Add patterns to recognize C++ 20 modules as "cpp". (Ben Jackson,
closesvim/vim#12261)
732d69e191
Co-authored-by: Ben Jackson <puremourning@gmail.com>
Problem: Code for making 'shortmess' temporarily empty is repeated.
Solution: Add functions for making 'shortmess' empty and restoring it.
(Christian Brabandt, closesvim/vim#11709)
9aee8ec400
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Only created files can be cleaned up with one call.
Solution: Add flags to mkdir() to delete with a deferred function.
Expand the writefile() name to a full path to handle changing
directory.
6f14da15ac
vim-patch:8.2.3742: dec mouse test fails without gnome terminfo entry
Problem: Dec mouse test fails without gnome terminfo entry.
Solution: Check if there is a gnome entry. Also fix 'acd' test on
MS-Windows. (Dominique Pellé, closesvim/vim#9282)
f589fd3e10
Cherry-pick test_autochdir.vim changes from patch 9.0.0313.
Cherry-pick test_autocmd.vim changes from patch 9.0.0323.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: :defer not tested with exceptions and ":qa!".
Solution: Test :defer works when exceptions are thrown and when ":qa!" is
used. Invoke the deferred calls on exit.
58779858fb
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cannot use a partial with :defer.
Solution: Add the partial arguments before the other arguments. Disallow
using a dictionary.
86d87256c4
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cleaning up after writefile() is a hassle.
Solution: Add the 'D' flag to defer deleting the written file. Very useful
in tests.
806a273f3c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cleaning up afterwards can make a function messy.
Solution: Add the :defer command.
1d84f7608f
Omit EX_EXPR_ARG: Vim9 script only.
Make :def throw E319 to avoid confusing behavior.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Test fails because of using Vim9 syntax in legacy function.
Solution: Add "call".
4f16e9de98
Add test_nested_function.vim changes from patches 8.{0.0141,2.1432}.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Confusing error for using a variable as a function.
Solution: If a function is not found but there is a variable, give a more
useful error. (issue vim/vim#9310)
2ef9156b42
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Crash when using a null function reference. (Naohiro Ono)
Solution: Check for an invalid function name. (closesvim/vim#8367)
22db0d549f
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Crash when passing NULL function to reduce().
Solution: Check for NULL pointer and give an error. (Dominique Pellé,
closesvim/vim#7243)
0d90e728fe
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Memory allocation failure not tested when defining a function.
Solution: Add a test. (Yegappan Lakshmanan, closesvim/vim#10127)
7c7e19cf50
test_alloc_fail() is N/A.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: getscriptinfo() loops even when specific SID is given.
Solution: Only loop when needed. Give a clearer error message.
(closesvim/vim#12207)
2d68b722e3
Problem: It is not easy to get information about a script.
Solution: Make getscriptinf() return the version. When selecting a specific
script return functions and variables. (Yegappan Lakshmanan,
closesvim/vim#10991)
2f892d8663
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: getscriptinfo() does not include the version. Cannot select
entries by script name.
Solution: Add the "version" item and the "name" argument. (Yegappan
Lakshmanan, closesvim/vim#10962)
520f6ef60a
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: String interpolation fails when not evaluating.
Solution: Skip the expression when not evaluating. (closesvim/vim#10398)
70c41241c2
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Interpolated string expression requires escaping.
Solution: Do not require escaping in the expression.
0abc2871c1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: String interpolation only works in heredoc.
Solution: Support interpolated strings. Use syntax for heredoc consistent
with strings, similar to C#. (closesvim/vim#10327)
2eaef106e4
Cherry-pick Test_Debugger_breakadd_expr() from Vim.
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem: Heredoc expression evaluated even when skipping.
Solution: Don't evaluate when "skip" is set. (closesvim/vim#10306)
05c7f5d3d0
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: not enough tests.
Solution: Run more expression tests also with Vim9. Fix an uncovered
problem.
fea43e44c0
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cannot put space between function name and paren.
Solution: Allow this for backwards compatibility.
bbd3e3c357
This fixes a regression from patch 8.2.1365, which isn't ported yet.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Using channel or job with ":execute" has strange effects.
Solution: Give an error message for Job and Channel.
b662591e50
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Using null object with execute() has strange effects.
Solution: Give an error message ofr Job and Channel.
e2a8f0773e
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Messages test fails in small version.
Solution: Only use test_null_job() when available.
da292b07af
Co-authored-by: Bram Moolenaar <Bram@vim.org>