Problem: Vim script debugger functionality needs cleanup.
Solution: Move debugger code to a separate file. Add more tests. (Yegappan
Lakshmanan, closesvim/vim#4285)
eead75c5e8
Good to have for eval_expr_restore in v8.2.3417.
Doesn't actually add any tests.
v:lua expressions are represented using vvlua_partial. As v:lua isn't
intended to be called directly, it's given an empty pt_name.
Because of this, calling v:lua directly like "v:lua()" will cause "E117:
Unknown function: ", with an empty name.
Instead, have call_func() show the name "v:lua" in the emsg.
Problem: Cannot use a user defined function as a method.
Solution: Pass the base as the first argument to the user defined function
after "->". (partly by FUJIWARA Takuya)
fcfe1a9b89
Problem: All builtin functions are global.
Solution: Add the method call operator ->. Implemented for a limited number
of functions.
ac92e25a33
- Note that to *exactly* port hunk @@ -7376,18 +7444,19 from
handle_subscript(), we need the :scriptversion patches (I have an open
PR for those, but this patch works fine without them anyway).
- Port call_internal_func() from v7.4.2058.
- Adjust some error messages in tests, as they rely on the Blob patches.
- Add a modeline to test_method.vim.
Ignore the global_functions and base_method tables and prefer the
current GPerf implementation. Instead, add an extra base_arg field to
VimLFuncDef that holds the number of the argument to use as the base
(1-indexed, so that 0 may be used to refer to functions that cannot be
used as methods).
This also means we support using any argument as a base from the get-go,
rather than just the first (Vim includes this ability in future patches,
however).
To mark a function as usable as a method, use the "base" key as
described in eval.lua.
Problem: Function call functions have too many arguments.
Solution: Pass values in a funcexe_T struct.
c6538bcc1c
Use FUNCEXE_INIT to initialize funcexe_T instances.
call_callback() and other Vim listener related stuff is N/A.
Problem: Named function arguments are never optional.
Solution: Support optional function arguments with a default value. (Andy
Massimino, closesvim/vim#3952)
42ae78cfff
Problem: Many type casts are used for vim_strnsave().
Solution: Make the length argument size_t instead of int. (Ken Takata,
closesvim/vim#5633) Remove some type casts.
df44a27b53
N/A patches for version.c:
vim-patch:8.2.0315: build failure on HP-UX system
Problem: Build failure on HP-UX system.
Solution: Use LONG_LONG_MIN instead of LLONG_MIN. Add type casts for switch
statement. (John Marriott)
c593bec412
vim-patch:8.2.1052: build failure with older compilers
Problem: Build failure with older compilers.
Solution: Move declaration to start of block.
7acde51832
vim-patch:8.2.2229: build failure without the +eval feature
Problem: build failure without the +eval feature.
Solution: Add #ifdef.
39cb2dab18
vim-patch:8.2.2232: compiler error for falling through into next case
Problem: Compiler error for falling through into next case.
Solution: Move FALLTHROUGH below the #endif
9618a25b9c
Problem: Calling a lambda is slower than evaluating a string.
Solution: Make calling a lambda faster. (Ken Takata, closesvim/vim#5727)
f10806b250
Port "uf_flags" constants from patch 8.2.1054 to sync with Vim.
Port user_func_error() from patch 8.2.0149.
Port Test_lambda_scope() changes from patch 8.1.0736 so that it passes.
Problem: Computing function length name in many places.
Solution: compute name length in call_func().
6ed8819822
In call_func(), reassign "len" param to (int)STRLEN(funcname)
instead of using vim_strsave() which runs strlen().
"len" param is checked for v:lua functions.
call_func() states that strlen() is used if "len" is set to -1.
Problem: Crash when using closures.
Solution: Set reference in varlist of funccal when running the garbage
collector. (Ozaki Kiichi, closesvim/vim#4554, closesvim/vim#4547)
6e5000d493
vim-patch:8.2.1054: not so easy to pass a lua function to Vim
vim-patch:8.2.1084: Lua: registering function has useless code
I think I have also opened up the possibility for people to use these
callbacks elsewhere, since I've added a new struct that we should be
able to use.
Also, this should allow us to determine what the state of a list is in
Lua or a dictionary in Lua, since we now can track the luaref as we go.
Problem: Using closure may consume a lot of memory.
Solution: unreference items that are no longer needed. Add a test. (Ozaki
Kiichi, closesvim/vim#3961)
209b8e3e3b
Problem: Crash if triggering garbage collector after a function call.
(Michael Henry)
Solution: Don't call the garbage collector right away, do it later.
(closesvim/vim#3894)
889da2f243
Problem: May use a lot of memory when a function creates a cyclic
reference.
Solution: After saving a funccal many times, invoke the garbage collector.
(closesvim/vim#3835)
4456ab527a