aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/funcs.h
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-08-05 19:46:42 +0100
committerSean Dewar <seandewar@users.noreply.github.com>2021-08-12 22:35:19 +0100
commite6be6c307a832d661d2a6269ad2d322e4bf5e9cc (patch)
treeb2b4e54254af2af04763d4f650c43e481b36cd8b /src/nvim/eval/funcs.h
parent4042ae5a2bc4bbca608ebb196a3d54a78d6c100c (diff)
downloadrneovim-e6be6c307a832d661d2a6269ad2d322e4bf5e9cc.tar.gz
rneovim-e6be6c307a832d661d2a6269ad2d322e4bf5e9cc.tar.bz2
rneovim-e6be6c307a832d661d2a6269ad2d322e4bf5e9cc.zip
vim-patch:8.1.1803: all builtin functions are global
Problem: All builtin functions are global. Solution: Add the method call operator ->. Implemented for a limited number of functions. https://github.com/vim/vim/commit/ac92e25a33c37ec5becbfffeccda136c73b761ac - 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.
Diffstat (limited to 'src/nvim/eval/funcs.h')
-rw-r--r--src/nvim/eval/funcs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nvim/eval/funcs.h b/src/nvim/eval/funcs.h
index a343290734..3ad0b8282a 100644
--- a/src/nvim/eval/funcs.h
+++ b/src/nvim/eval/funcs.h
@@ -14,6 +14,7 @@ typedef struct fst {
char *name; ///< Name of the function.
uint8_t min_argc; ///< Minimal number of arguments.
uint8_t max_argc; ///< Maximal number of arguments.
+ uint8_t base_arg; ///< Method base arg # (1-indexed), or 0 if not a method.
VimLFunc func; ///< Function implementation.
FunPtr data; ///< Userdata for function implementation.
} VimLFuncDef;