From e6be6c307a832d661d2a6269ad2d322e4bf5e9cc Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Thu, 5 Aug 2021 19:46:42 +0100 Subject: 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. --- src/nvim/eval.lua | 51 +++++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 24 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index eb20cd1bc8..f94ecffed9 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -5,6 +5,9 @@ -- args Number of arguments, list with maximum and minimum number of arguments -- or list with a minimum number of arguments only. Defaults to zero -- arguments. +-- base For methods: the argument to use as the base argument (1-indexed): +-- base->method() +-- Defaults to zero (function cannot be used as a method). -- func Name of the C function which implements the VimL function. Defaults to -- `f_{funcname}`. @@ -16,7 +19,7 @@ return { funcs={ abs={args=1}, acos={args=1, func="float_op_wrapper", data="&acos"}, -- WJMc - add={args=2}, + add={args=2, base=1}, ['and']={args=2}, api_info={}, append={args=2}, @@ -73,10 +76,10 @@ return { complete_check={}, complete_info={args={0, 1}}, confirm={args={1, 4}}, - copy={args=1}, + copy={args=1, base=1}, cos={args=1, func="float_op_wrapper", data="&cos"}, cosh={args=1, func="float_op_wrapper", data="&cosh"}, - count={args={2, 4}}, + count={args={2, 4}, base=1}, cscope_connection={args={0, 3}}, ctxget={args={0, 1}}, ctxpop={}, @@ -93,7 +96,7 @@ return { did_filetype={}, diff_filler={args=1}, diff_hlID={args=2}, - empty={args=1}, + empty={args=1, base=1}, environ={}, escape={args=2}, eval={args=1}, @@ -105,12 +108,12 @@ return { exp={args=1, func="float_op_wrapper", data="&exp"}, expand={args={1, 3}}, expandcmd={args=1}, - extend={args={2, 3}}, + extend={args={2, 3}, base=1}, feedkeys={args={1, 2}}, file_readable={args=1, func='f_filereadable'}, -- obsolete filereadable={args=1}, filewritable={args=1}, - filter={args=2}, + filter={args=2, base=1}, finddir={args={1, 3}}, findfile={args={1, 3}}, flatten={args={1, 2}}, @@ -128,7 +131,7 @@ return { funcref={args={1, 3}}, ['function']={args={1, 3}}, garbagecollect={args={0, 1}}, - get={args={2, 3}}, + get={args={2, 3}, base=1}, getbufinfo={args={0, 1}}, getbufline={args={2, 3}}, getbufvar={args={2, 3}}, @@ -187,14 +190,14 @@ return { hostname={}, iconv={args=3}, indent={args=1}, - index={args={2, 4}}, + index={args={2, 4}, base=1}, input={args={1, 3}}, inputdialog={args={1, 3}}, inputlist={args=1}, inputrestore={}, inputsave={}, inputsecret={args={1, 2}}, - insert={args={2, 3}}, + insert={args={2, 3}, base=1}, interrupt={args=0}, invert={args=1}, isdirectory={args=1}, @@ -202,7 +205,7 @@ return { islocked={args=1}, isnan={args=1}, id={args=1}, - items={args=1}, + items={args=1, base=1}, jobclose={args={1, 2}, func="f_chanclose"}, jobpid={args=1}, jobresize={args=3}, @@ -210,12 +213,12 @@ return { jobstart={args={1, 2}}, jobstop={args=1}, jobwait={args={1, 2}}, - join={args={1, 2}}, + join={args={1, 2}, base=1}, json_decode={args=1}, json_encode={args=1}, - keys={args=1}, + keys={args=1, base=1}, last_buffer_nr={}, -- obsolete - len={args=1}, + len={args=1, base=1}, libcall={args=3}, libcallnr={args=3}, line={args={1, 2}}, @@ -226,7 +229,7 @@ return { log={args=1, func="float_op_wrapper", data="&log"}, log10={args=1, func="float_op_wrapper", data="&log10"}, luaeval={args={1, 2}}, - map={args=2}, + map={args=2, base=1}, maparg={args={1, 4}}, mapcheck={args={1, 3}}, match={args={2, 4}}, @@ -238,9 +241,9 @@ return { matchlist={args={2, 4}}, matchstr={args={2, 4}}, matchstrpos={args={2,4}}, - max={args=1}, + max={args=1, base=1}, menu_get={args={1, 2}}, - min={args=1}, + min={args=1, base=1}, mkdir={args={1, 3}}, mode={args={0, 1}}, msgpackdump={args=1}, @@ -270,11 +273,11 @@ return { reltime={args={0, 2}}, reltimefloat={args=1}, reltimestr={args=1}, - remove={args={2, 3}}, + remove={args={2, 3}, base=1}, rename={args=2}, - ['repeat']={args=2}, + ['repeat']={args=2, base=1}, resolve={args=1}, - reverse={args=1}, + reverse={args=1, base=1}, round={args=1, func="float_op_wrapper", data="&round"}, rpcnotify={args=varargs(2)}, rpcrequest={args=varargs(2)}, @@ -327,7 +330,7 @@ return { sin={args=1, func="float_op_wrapper", data="&sin"}, sinh={args=1, func="float_op_wrapper", data="&sinh"}, sockconnect={args={2,3}}, - sort={args={1, 3}}, + sort={args={1, 3}, base=1}, soundfold={args=1}, stdioopen={args=1}, spellbadword={args={0, 1}}, @@ -344,7 +347,7 @@ return { strftime={args={1, 2}}, strgetchar={args={2, 2}}, stridx={args={2, 3}}, - string={args=1}, + string={args=1, base=1}, strlen={args=1}, strpart={args={2, 4}}, strptime={args=2}, @@ -383,11 +386,11 @@ return { tr={args=3}, trim={args={1,3}}, trunc={args=1, func="float_op_wrapper", data="&trunc"}, - type={args=1}, + type={args=1, base=1}, undofile={args=1}, undotree={}, - uniq={args={1, 3}}, - values={args=1}, + uniq={args={1, 3}, base=1}, + values={args=1, base=1}, virtcol={args=1}, visualmode={args={0, 1}}, wait={args={2,3}}, -- cgit From 003c8acc8a9863932430bfb51bee8403b964c19b Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Fri, 6 Aug 2021 17:09:47 +0100 Subject: vim-patch:8.1.1807: more functions can be used as a method Problem: More functions can be used as a method. Solution: Add append(), appendbufline(), assert_equal(), etc. Also add the :eval command. https://github.com/vim/vim/commit/25e42231d3ee27feec2568fa4be2aa2bfba82ae5 :eval is already ported. --- src/nvim/eval.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index f94ecffed9..506368a3b2 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -7,7 +7,7 @@ -- arguments. -- base For methods: the argument to use as the base argument (1-indexed): -- base->method() --- Defaults to zero (function cannot be used as a method). +-- Defaults to BASE_NONE (function cannot be used as a method). -- func Name of the C function which implements the VimL function. Defaults to -- `f_{funcname}`. @@ -15,6 +15,10 @@ local varargs = function(nr) return {nr} end +-- Usable with the base key: use the last function argument as the method base. +-- Value is from funcs.h file. "BASE_" prefix is omitted. +local LAST = "BASE_LAST" + return { funcs={ abs={args=1}, @@ -22,15 +26,15 @@ return { add={args=2, base=1}, ['and']={args=2}, api_info={}, - append={args=2}, - appendbufline={args=3}, + append={args=2, base=LAST}, + appendbufline={args=3, base=LAST}, argc={args={0, 1}}, argidx={}, arglistid={args={0, 2}}, argv={args={0, 2}}, asin={args=1, func="float_op_wrapper", data="&asin"}, -- WJMc assert_beeps={args={1}}, - assert_equal={args={2, 3}}, + assert_equal={args={2, 3}, base=2}, assert_equalfile={args={2, 3}}, assert_exception={args={1, 2}}, assert_fails={args={1, 3}}, @@ -38,7 +42,7 @@ return { assert_inrange={args={3, 4}}, assert_match={args={2, 3}}, assert_nobeep={args={1}}, - assert_notequal={args={2, 3}}, + assert_notequal={args={2, 3}, base=2}, assert_notmatch={args={2, 3}}, assert_report={args=1}, assert_true={args={1, 2}}, @@ -99,7 +103,7 @@ return { empty={args=1, base=1}, environ={}, escape={args=2}, - eval={args=1}, + eval={args=1, base=1}, eventhandler={}, executable={args=1}, execute={args={1, 2}}, -- cgit From aa2dc8b7b4e0e86c9102f2df6b670317c5693657 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Fri, 6 Aug 2021 18:10:30 +0100 Subject: vim-patch:8.1.1809: more functions can be used as a method Problem: More functions can be used as a method. Solution: Add has_key(), split(), str2list(), etc. https://github.com/vim/vim/commit/a74e4946de074d2916e3d6004f7fa1810d12dda9 --- src/nvim/eval.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 506368a3b2..50b6eaadfd 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -180,7 +180,7 @@ return { glob2regpat={args=1}, globpath={args={2, 5}}, has={args=1}, - has_key={args=2}, + has_key={args=2, base=1}, haslocaldir={args={0,2}}, hasmapto={args={1, 3}}, highlightID={args=1, func='f_hlID'}, -- obsolete @@ -339,11 +339,11 @@ return { stdioopen={args=1}, spellbadword={args={0, 1}}, spellsuggest={args={1, 3}}, - split={args={1, 3}}, + split={args={1, 3}, base=1}, sqrt={args=1, func="float_op_wrapper", data="&sqrt"}, stdpath={args=1}, str2float={args=1}, - str2list={args={1, 2}}, + str2list={args={1, 2}, base=1}, str2nr={args={1, 2}}, strcharpart={args={2, 3}}, strchars={args={1,2}}, @@ -352,23 +352,23 @@ return { strgetchar={args={2, 2}}, stridx={args={2, 3}}, string={args=1, base=1}, - strlen={args=1}, + strlen={args=1, base=1}, strpart={args={2, 4}}, strptime={args=2}, strridx={args={2, 3}}, - strtrans={args=1}, - strwidth={args=1}, + strtrans={args=1, base=1}, + strwidth={args=1, base=1}, submatch={args={1, 2}}, - substitute={args=4}, + substitute={args=4, base=1}, swapinfo={args={1}}, swapname={args={1}}, synID={args=3}, - synIDattr={args={2, 3}}, - synIDtrans={args=1}, + synIDattr={args={2, 3}, base=1}, + synIDtrans={args=1, base=1}, synconcealed={args=2}, synstack={args=2}, - system={args={1, 2}}, - systemlist={args={1, 3}}, + system={args={1, 2}, base=1}, + systemlist={args={1, 3}, base=1}, tabpagebuflist={args={0, 1}}, tabpagenr={args={0, 1}}, tabpagewinnr={args={1, 2}}, -- cgit From f03dd22f0d37af88f40a27c694c3265026178e80 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sat, 7 Aug 2021 01:08:22 +0100 Subject: vim-patch:8.1.1835: cannot use printf() as a method Problem: Cannot use printf() as a method. Solution: Pass the base as the second argument to printf(). https://github.com/vim/vim/commit/fd8ca21b3ff207e44891aef922935d4adcd140cf --- src/nvim/eval.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 50b6eaadfd..1821ae51d7 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -258,7 +258,7 @@ return { pathshorten={args=1}, pow={args=2}, prevnonblank={args=1}, - printf={args=varargs(1)}, + printf={args=varargs(1), base=2}, prompt_getprompt={args=1}, prompt_setcallback={args={2, 2}}, prompt_setinterrupt={args={2, 2}}, -- cgit From 287a77ef51a7a12813d3fa6e1c49c595e5951ba5 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sat, 7 Aug 2021 01:28:52 +0100 Subject: vim-patch:8.1.1861: only some assert functions can be used as a method Problem: Only some assert functions can be used as a method. Solution: Allow using most assert functions as a method. https://github.com/vim/vim/commit/24278d2407dfbc8d93eb36593cdd006ff5d86f94 Port tests to assert_spec.lua. --- src/nvim/eval.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 1821ae51d7..a629fd9889 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -33,19 +33,19 @@ return { arglistid={args={0, 2}}, argv={args={0, 2}}, asin={args=1, func="float_op_wrapper", data="&asin"}, -- WJMc - assert_beeps={args={1}}, + assert_beeps={args={1}, base=1}, assert_equal={args={2, 3}, base=2}, assert_equalfile={args={2, 3}}, assert_exception={args={1, 2}}, - assert_fails={args={1, 3}}, - assert_false={args={1, 2}}, - assert_inrange={args={3, 4}}, - assert_match={args={2, 3}}, + assert_fails={args={1, 3}, base=1}, + assert_false={args={1, 2}, base=1}, + assert_inrange={args={3, 4}, base=3}, + assert_match={args={2, 3}, base=2}, assert_nobeep={args={1}}, assert_notequal={args={2, 3}, base=2}, - assert_notmatch={args={2, 3}}, + assert_notmatch={args={2, 3}, base=2}, assert_report={args=1}, - assert_true={args={1, 2}}, + assert_true={args={1, 2}, base=1}, atan={args=1, func="float_op_wrapper", data="&atan"}, atan2={args=2}, browse={args=4}, -- cgit From 41dbd3a2e05f5f4d59e076f8b8c82ad974d2bbd5 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sat, 7 Aug 2021 16:27:23 +0100 Subject: vim-patch:8.1.1879: more functions can be used as methods Problem: More functions can be used as methods. Solution: Make float functions usable as a method. https://github.com/vim/vim/commit/93cf85f9ef02931de3f8c8e536a137da0b48b7dc Fix atan2() doc typo (patch referred to it as atan()). Adjust Test_fmod() method test to expect "str2float('nan')". --- src/nvim/eval.lua | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index a629fd9889..1cac57a8ff 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -21,8 +21,8 @@ local LAST = "BASE_LAST" return { funcs={ - abs={args=1}, - acos={args=1, func="float_op_wrapper", data="&acos"}, -- WJMc + abs={args=1, base=1}, + acos={args=1, base=1, func="float_op_wrapper", data="&acos"}, -- WJMc add={args=2, base=1}, ['and']={args=2}, api_info={}, @@ -32,7 +32,7 @@ return { argidx={}, arglistid={args={0, 2}}, argv={args={0, 2}}, - asin={args=1, func="float_op_wrapper", data="&asin"}, -- WJMc + asin={args=1, base=1, func="float_op_wrapper", data="&asin"}, -- WJMc assert_beeps={args={1}, base=1}, assert_equal={args={2, 3}, base=2}, assert_equalfile={args={2, 3}}, @@ -46,8 +46,8 @@ return { assert_notmatch={args={2, 3}, base=2}, assert_report={args=1}, assert_true={args={1, 2}, base=1}, - atan={args=1, func="float_op_wrapper", data="&atan"}, - atan2={args=2}, + atan={args=1, base=1, func="float_op_wrapper", data="&atan"}, + atan2={args=2, base=1}, browse={args=4}, browsedir={args=2}, bufadd={args=1}, @@ -66,7 +66,7 @@ return { byteidx={args=2}, byteidxcomp={args=2}, call={args={2, 3}}, - ceil={args=1, func="float_op_wrapper", data="&ceil"}, + ceil={args=1, base=1, func="float_op_wrapper", data="&ceil"}, changenr={}, chanclose={args={1, 2}}, chansend={args=2}, @@ -81,8 +81,8 @@ return { complete_info={args={0, 1}}, confirm={args={1, 4}}, copy={args=1, base=1}, - cos={args=1, func="float_op_wrapper", data="&cos"}, - cosh={args=1, func="float_op_wrapper", data="&cosh"}, + cos={args=1, base=1, func="float_op_wrapper", data="&cos"}, + cosh={args=1, base=1, func="float_op_wrapper", data="&cosh"}, count={args={2, 4}, base=1}, cscope_connection={args={0, 3}}, ctxget={args={0, 1}}, @@ -109,7 +109,7 @@ return { execute={args={1, 2}}, exepath={args=1}, exists={args=1}, - exp={args=1, func="float_op_wrapper", data="&exp"}, + exp={args=1, base=1, func="float_op_wrapper", data="&exp"}, expand={args={1, 3}}, expandcmd={args=1}, extend={args={2, 3}, base=1}, @@ -121,9 +121,9 @@ return { finddir={args={1, 3}}, findfile={args={1, 3}}, flatten={args={1, 2}}, - float2nr={args=1}, - floor={args=1, func="float_op_wrapper", data="&floor"}, - fmod={args=2}, + float2nr={args=1, base=1}, + floor={args=1, base=1, func="float_op_wrapper", data="&floor"}, + fmod={args=2, base=1}, fnameescape={args=1}, fnamemodify={args=2}, foldclosed={args=1}, @@ -205,9 +205,9 @@ return { interrupt={args=0}, invert={args=1}, isdirectory={args=1}, - isinf={args=1}, + isinf={args=1, base=1}, islocked={args=1}, - isnan={args=1}, + isnan={args=1, base=1}, id={args=1}, items={args=1, base=1}, jobclose={args={1, 2}, func="f_chanclose"}, @@ -230,8 +230,8 @@ return { lispindent={args=1}, list2str={args={1, 2}}, localtime={}, - log={args=1, func="float_op_wrapper", data="&log"}, - log10={args=1, func="float_op_wrapper", data="&log10"}, + log={args=1, base=1, func="float_op_wrapper", data="&log"}, + log10={args=1, base=1, func="float_op_wrapper", data="&log10"}, luaeval={args={1, 2}}, map={args=2, base=1}, maparg={args={1, 4}}, @@ -256,7 +256,7 @@ return { nr2char={args={1, 2}}, ['or']={args=2}, pathshorten={args=1}, - pow={args=2}, + pow={args=2, base=1}, prevnonblank={args=1}, printf={args=varargs(1), base=2}, prompt_getprompt={args=1}, @@ -282,7 +282,7 @@ return { ['repeat']={args=2, base=1}, resolve={args=1}, reverse={args=1, base=1}, - round={args=1, func="float_op_wrapper", data="&round"}, + round={args=1, base=1, func="float_op_wrapper", data="&round"}, rpcnotify={args=varargs(2)}, rpcrequest={args=varargs(2)}, rpcstart={args={1, 2}}, @@ -331,8 +331,8 @@ return { sign_unplace={args={1, 2}}, sign_unplacelist={args={1}}, simplify={args=1}, - sin={args=1, func="float_op_wrapper", data="&sin"}, - sinh={args=1, func="float_op_wrapper", data="&sinh"}, + sin={args=1, base=1, func="float_op_wrapper", data="&sin"}, + sinh={args=1, base=1, func="float_op_wrapper", data="&sinh"}, sockconnect={args={2,3}}, sort={args={1, 3}, base=1}, soundfold={args=1}, @@ -340,9 +340,9 @@ return { spellbadword={args={0, 1}}, spellsuggest={args={1, 3}}, split={args={1, 3}, base=1}, - sqrt={args=1, func="float_op_wrapper", data="&sqrt"}, + sqrt={args=1, base=1, func="float_op_wrapper", data="&sqrt"}, stdpath={args=1}, - str2float={args=1}, + str2float={args=1, base=1}, str2list={args={1, 2}, base=1}, str2nr={args={1, 2}}, strcharpart={args={2, 3}}, @@ -374,8 +374,8 @@ return { tabpagewinnr={args={1, 2}}, tagfiles={}, taglist={args={1, 2}}, - tan={args=1, func="float_op_wrapper", data="&tan"}, - tanh={args=1, func="float_op_wrapper", data="&tanh"}, + tan={args=1, base=1, func="float_op_wrapper", data="&tan"}, + tanh={args=1, base=1, func="float_op_wrapper", data="&tanh"}, tempname={}, termopen={args={1, 2}}, test_garbagecollect_now={}, @@ -389,7 +389,7 @@ return { toupper={args=1}, tr={args=3}, trim={args={1,3}}, - trunc={args=1, func="float_op_wrapper", data="&trunc"}, + trunc={args=1, base=1, func="float_op_wrapper", data="&trunc"}, type={args=1, base=1}, undofile={args=1}, undotree={}, -- cgit From 5fbc1a49c719c0c93fa73277ac30d17f797d096d Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sat, 7 Aug 2021 17:06:08 +0100 Subject: vim-patch:8.1.1888: more functions can be used as methods Problem: More functions can be used as methods. Solution: Make various functions usable as a method. https://github.com/vim/vim/commit/073e4b92e613d22ce7b16e0fbf5c0e40cb5f9b2c test_popup.vim already has the changes from this patch (they're N/A anyway). --- src/nvim/eval.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 1cac57a8ff..6f8645c806 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -24,7 +24,7 @@ return { abs={args=1, base=1}, acos={args=1, base=1, func="float_op_wrapper", data="&acos"}, -- WJMc add={args=2, base=1}, - ['and']={args=2}, + ['and']={args=2, base=1}, api_info={}, append={args=2, base=LAST}, appendbufline={args=3, base=LAST}, @@ -50,16 +50,16 @@ return { atan2={args=2, base=1}, browse={args=4}, browsedir={args=2}, - bufadd={args=1}, - bufexists={args=1}, - buffer_exists={args=1, func='f_bufexists'}, -- obsolete + bufadd={args=1, base=1}, + bufexists={args=1, base=1}, + buffer_exists={args=1, base=1, func='f_bufexists'}, -- obsolete buffer_name={args={0, 1}, func='f_bufname'}, -- obsolete buffer_number={args={0, 1}, func='f_bufnr'}, -- obsolete - buflisted={args=1}, - bufload={args=1}, - bufloaded={args=1}, - bufname={args={0, 1}}, - bufnr={args={0, 2}}, + buflisted={args=1, base=1}, + bufload={args=1, base=1}, + bufloaded={args=1, base=1}, + bufname={args={0, 1}, base=1}, + bufnr={args={0, 2}, base=1}, bufwinid={args=1}, bufwinnr={args=1}, byte2line={args=1}, @@ -203,7 +203,7 @@ return { inputsecret={args={1, 2}}, insert={args={2, 3}, base=1}, interrupt={args=0}, - invert={args=1}, + invert={args=1, base=1}, isdirectory={args=1}, isinf={args=1, base=1}, islocked={args=1}, @@ -254,7 +254,7 @@ return { msgpackparse={args=1}, nextnonblank={args=1}, nr2char={args={1, 2}}, - ['or']={args=2}, + ['or']={args=2, base=1}, pathshorten={args=1}, pow={args=2, base=1}, prevnonblank={args=1}, @@ -421,6 +421,6 @@ return { winwidth={args=1}, wordcount={}, writefile={args={2, 3}}, - xor={args=2}, + xor={args=2, base=1}, }, } -- cgit From 7925f0b6330c18c9391d02f844cd17b41fbb3d2e Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sat, 7 Aug 2021 17:53:43 +0100 Subject: vim-patch:8.1.1909: more functions can be used as methods Problem: More functions can be used as methods. Solution: Make a few more functions usable as a method. https://github.com/vim/vim/commit/e49fbff384e45dd17fed72321c26937edf6de16b --- src/nvim/eval.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 6f8645c806..722f413d82 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -35,7 +35,7 @@ return { asin={args=1, base=1, func="float_op_wrapper", data="&asin"}, -- WJMc assert_beeps={args={1}, base=1}, assert_equal={args={2, 3}, base=2}, - assert_equalfile={args={2, 3}}, + assert_equalfile={args={2, 3}, base=1}, assert_exception={args={1, 2}}, assert_fails={args={1, 3}, base=1}, assert_false={args={1, 2}, base=1}, @@ -44,7 +44,7 @@ return { assert_nobeep={args={1}}, assert_notequal={args={2, 3}, base=2}, assert_notmatch={args={2, 3}, base=2}, - assert_report={args=1}, + assert_report={args=1, base=1}, assert_true={args={1, 2}, base=1}, atan={args=1, base=1, func="float_op_wrapper", data="&atan"}, atan2={args=2, base=1}, @@ -60,8 +60,8 @@ return { bufloaded={args=1, base=1}, bufname={args={0, 1}, base=1}, bufnr={args={0, 2}, base=1}, - bufwinid={args=1}, - bufwinnr={args=1}, + bufwinid={args=1, base=1}, + bufwinnr={args=1, base=1}, byte2line={args=1}, byteidx={args=2}, byteidxcomp={args=2}, @@ -408,7 +408,7 @@ return { win_id2win={args=1}, win_screenpos={args=1}, win_splitmove={args={2, 3}}, - winbufnr={args=1}, + winbufnr={args=1, base=1}, wincol={}, windowsversion={}, winheight={args=1}, -- cgit From 56b56a76e8294a319d2db32581f82421d4a4d446 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sat, 7 Aug 2021 18:09:39 +0100 Subject: vim-patch:8.1.1911: more functions can be used as methods Problem: More functions can be used as methods. Solution: Make a few more functions usable as a method. https://github.com/vim/vim/commit/64b4d73524b9a2304d89b87529cd8d3cef14b856 Note that the old-style version of Test_byteidx() was already translated to a Lua test in 069_multibyte_formatting_spec.lua. Keep both versions, using Test_byteidx() to mainly test the method call syntax for byteidx() and byteidxcomp(). --- src/nvim/eval.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 722f413d82..24f4b5fc49 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -62,10 +62,10 @@ return { bufnr={args={0, 2}, base=1}, bufwinid={args=1, base=1}, bufwinnr={args=1, base=1}, - byte2line={args=1}, - byteidx={args=2}, - byteidxcomp={args=2}, - call={args={2, 3}}, + byte2line={args=1, base=1}, + byteidx={args=2, base=1}, + byteidxcomp={args=2, base=1}, + call={args={2, 3}, base=1}, ceil={args=1, base=1, func="float_op_wrapper", data="&ceil"}, changenr={}, chanclose={args={1, 2}}, -- cgit From 5d883498179651c6da95b10959e83cf8707eaa4f Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sat, 7 Aug 2021 22:39:23 +0100 Subject: feat(eval): partially port v8.1.1915 Cannot be fully ported as chdir() hasn't been ported yet. --- src/nvim/eval.lua | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 24f4b5fc49..faff29b268 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -70,16 +70,16 @@ return { changenr={}, chanclose={args={1, 2}}, chansend={args=2}, - char2nr={args={1, 2}}, + char2nr={args={1, 2}, base=1}, charidx={args={2, 3}}, - cindent={args=1}, - clearmatches={args={0, 1}}, - col={args=1}, - complete={args=2}, - complete_add={args=1}, + cindent={args=1, base=1}, + clearmatches={args={0, 1}, base=1}, + col={args=1, base=1}, + complete={args=2, base=2}, + complete_add={args=1, base=1}, complete_check={}, - complete_info={args={0, 1}}, - confirm={args={1, 4}}, + complete_info={args={0, 1}, base=1}, + confirm={args={1, 4}, base=1}, copy={args=1, base=1}, cos={args=1, base=1, func="float_op_wrapper", data="&cos"}, cosh={args=1, base=1, func="float_op_wrapper", data="&cosh"}, @@ -90,16 +90,16 @@ return { ctxpush={args={0, 1}}, ctxset={args={1, 2}}, ctxsize={}, - cursor={args={1, 3}}, - debugbreak={args={1, 1}}, - deepcopy={args={1, 2}}, - delete={args={1,2}}, - deletebufline={args={2,3}}, + cursor={args={1, 3}, base=1}, + debugbreak={args={1, 1}, base=1}, + deepcopy={args={1, 2}, base=1}, + delete={args={1,2}, base=1}, + deletebufline={args={2,3}, base=1}, dictwatcheradd={args=3}, dictwatcherdel={args=3}, did_filetype={}, - diff_filler={args=1}, - diff_hlID={args=2}, + diff_filler={args=1, base=1}, + diff_hlID={args=2, base=1}, empty={args=1, base=1}, environ={}, escape={args=2}, -- cgit