From 6110480c290011d96af37c0cba1e7309ef645efb Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sun, 8 Aug 2021 16:07:40 +0100 Subject: feat(eval/method): partially port v8.1.1921 Adds method call support for all functions in the patch, but it cannot be fully ported due to missing tests for: - filereadable(): requires v8.1.1378 for Test_delete_rf(), but there appears to have been some trouble porting it. (#12784) - confirm(): requires v8.1.0832 for Test_confirm() and v8.1.0815 for feedkeys()'s "L" flag. (I did attempt to port the test using nvim_input() instead, but seems that input handling for confirm() doesn't work in --headless mode?) Note that confirm() was actually added as a method in v8.1.1915. Uncomment use of method call syntax in Test_Executable() previously included instead from v8.2.2259. --- src/nvim/eval.lua | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index c6ac27b269..f9f6af3bfd 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -102,38 +102,38 @@ return { diff_hlID={args=2, base=1}, empty={args=1, base=1}, environ={}, - escape={args=2}, + escape={args=2, base=1}, eval={args=1, base=1}, eventhandler={}, - executable={args=1}, - execute={args={1, 2}}, - exepath={args=1}, - exists={args=1}, + executable={args=1, base=1}, + execute={args={1, 2}, base=1}, + exepath={args=1, base=1}, + exists={args=1, base=1}, exp={args=1, base=1, func="float_op_wrapper", data="&exp"}, - expand={args={1, 3}}, - expandcmd={args=1}, + expand={args={1, 3}, base=1}, + expandcmd={args=1, base=1}, extend={args={2, 3}, base=1}, - feedkeys={args={1, 2}}, - file_readable={args=1, func='f_filereadable'}, -- obsolete - filereadable={args=1}, - filewritable={args=1}, + feedkeys={args={1, 2}, base=1}, + file_readable={args=1, base=1, func='f_filereadable'}, -- obsolete + filereadable={args=1, base=1}, + filewritable={args=1, base=1}, filter={args=2, base=1}, - finddir={args={1, 3}}, - findfile={args={1, 3}}, + finddir={args={1, 3}, base=1}, + findfile={args={1, 3}, base=1}, flatten={args={1, 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}, - foldclosedend={args=1}, - foldlevel={args=1}, + fnameescape={args=1, base=1}, + fnamemodify={args=2, base=1}, + foldclosed={args=1, base=1}, + foldclosedend={args=1, base=1}, + foldlevel={args=1, base=1}, foldtext={}, - foldtextresult={args=1}, + foldtextresult={args=1, base=1}, foreground={}, - funcref={args={1, 3}}, - ['function']={args={1, 3}}, + funcref={args={1, 3}, base=1}, + ['function']={args={1, 3}, base=1}, garbagecollect={args={0, 1}}, get={args={2, 3}, base=1}, getbufinfo={args={0, 1}}, -- cgit From 3137c7d63574a86ddc44f11c839e8e58c2994bf9 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Fri, 27 Aug 2021 21:09:37 +0100 Subject: feat(eval/method): partially port v8.1.1925 Adds method call support for all functions in the patch, but it cannot be fully ported due to missing tests for: - getcwd(): requires chdir() and Test_chdir_func() from v8.1.1291. Note that the method call tests for getreg() and getregtype() were removed in v8.2.1547, which has already been ported, but doesn't seem to have been replaced with a new test... This patch also makes getchangelist()'s argument optional (defaults to the current buffer). eval.txt includes a typo for gettabwinvar(), which is fixed in v8.1.1952. --- src/nvim/eval.lua | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index f9f6af3bfd..83a72cc233 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -137,9 +137,9 @@ return { garbagecollect={args={0, 1}}, get={args={2, 3}, base=1}, getbufinfo={args={0, 1}}, - getbufline={args={2, 3}}, - getbufvar={args={2, 3}}, - getchangelist={args={1, 1}}, + getbufline={args={2, 3}, base=1}, + getbufvar={args={2, 3}, base=1}, + getchangelist={args={0, 1}, base=1}, getchar={args={0, 1}}, getcharmod={}, getcharsearch={}, @@ -148,30 +148,30 @@ return { getcmdpos={}, getcmdtype={}, getcmdwintype={}, - getcompletion={args={2, 3}}, + getcompletion={args={2, 3}, base=1}, getcurpos={}, - getcwd={args={0,2}}, - getenv={args={1}}, + getcwd={args={0, 2}, base=1}, + getenv={args={1}, base=1}, getfontname={args={0, 1}}, - getfperm={args=1}, - getfsize={args=1}, - getftime={args=1}, - getftype={args=1}, - getjumplist={args={0, 2}}, - getline={args={1, 2}}, + getfperm={args=1, base=1}, + getfsize={args=1, base=1}, + getftime={args=1, base=1}, + getftype={args=1, base=1}, + getjumplist={args={0, 2}, base=1}, + getline={args={1, 2}, base=1}, getloclist={args={1, 2}}, getmarklist={args={0, 1}}, getmatches={args={0, 1}}, getmousepos={}, getpid={}, - getpos={args=1}, + getpos={args=1, base=1}, getqflist={args={0, 1}}, - getreg={args={0, 3}}, + getreg={args={0, 3}, base=1}, getreginfo={args={0, 1}, base=1}, - getregtype={args={0, 1}}, - gettabinfo={args={0, 1}}, - gettabvar={args={2, 3}}, - gettabwinvar={args={3, 4}}, + getregtype={args={0, 1}, base=1}, + gettabinfo={args={0, 1}, base=1}, + gettabvar={args={2, 3}, base=1}, + gettabwinvar={args={3, 4}, base=1}, gettagstack={args={0, 1}}, getwininfo={args={0, 1}}, getwinpos={args={0, 1}}, @@ -311,7 +311,7 @@ return { setcharsearch={args=1}, setcmdpos={args=1}, setenv={args=2}, - setfperm={args=2}, + setfperm={args=2, base=1}, setline={args=2}, setloclist={args={2, 4}}, setmatches={args={1, 2}}, -- cgit From 8b7615c735325245cff20907fbd7e0470a0d00d0 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Tue, 31 Aug 2021 22:41:44 +0100 Subject: vim-patch:8.1.1952: more functions can be used as a method Problem: More functions can be used as a method. Solution: Allow more functions to be used as a method. https://github.com/vim/vim/commit/5d69fdb7c4b91faf2d92b8d449cc9460f3035fb3 --- 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 83a72cc233..cc38a0734e 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -172,15 +172,15 @@ return { gettabinfo={args={0, 1}, base=1}, gettabvar={args={2, 3}, base=1}, gettabwinvar={args={3, 4}, base=1}, - gettagstack={args={0, 1}}, - getwininfo={args={0, 1}}, - getwinpos={args={0, 1}}, + gettagstack={args={0, 1}, base=1}, + getwininfo={args={0, 1}, base=1}, + getwinpos={args={0, 1}, base=1}, getwinposx={}, getwinposy={}, - getwinvar={args={2, 3}}, - glob={args={1, 4}}, - glob2regpat={args=1}, - globpath={args={2, 5}}, + getwinvar={args={2, 3}, base=1}, + glob={args={1, 4}, base=1}, + glob2regpat={args=1, base=1}, + globpath={args={2, 5}, base=2}, has={args=1}, has_key={args=2, base=1}, haslocaldir={args={0,2}}, -- cgit From 59c8a1fd5158886cb13b56070ebf15259d12eba2 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Tue, 31 Aug 2021 22:51:29 +0100 Subject: feat(eval/method): partially port v8.1.1953 Adds method call support for all functions in the patch, but it cannot be fully ported due to missing tests for: - index(): requires Blobs from v8.1.0735. Note that index() was already added as a method in v8.1.1803; this patch only adds a test. - iconv(): requires v8.1.1136 for test_termcodes.vim. Nvim deprecated inputdialog(), so it no longer has an eval.txt entry. Keep the test for hlexists() commented-out, just like previously. (Nvim always defines the Number group, so it always returns 1 instead) Cannot include both changes to test_syn_attr.vim as Nvim doesn't support ":hi term=..."; however, both test the same ->hlID() syntax anyway. --- src/nvim/eval.lua | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index cc38a0734e..f600b4ce06 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -183,32 +183,32 @@ return { globpath={args={2, 5}, base=2}, has={args=1}, has_key={args=2, base=1}, - haslocaldir={args={0,2}}, - hasmapto={args={1, 3}}, - highlightID={args=1, func='f_hlID'}, -- obsolete - highlight_exists={args=1, func='f_hlexists'}, -- obsolete - histadd={args=2}, - histdel={args={1, 2}}, - histget={args={1, 2}}, - histnr={args=1}, - hlID={args=1}, - hlexists={args=1}, + haslocaldir={args={0, 2}, base=1}, + hasmapto={args={1, 3}, base=1}, + highlightID={args=1, base=1, func='f_hlID'}, -- obsolete + highlight_exists={args=1, base=1, func='f_hlexists'}, -- obsolete + histadd={args=2, base=2}, + histdel={args={1, 2}, base=1}, + histget={args={1, 2}, base=1}, + histnr={args=1, base=1}, + hlID={args=1, base=1}, + hlexists={args=1, base=1}, hostname={}, - iconv={args=3}, - indent={args=1}, + iconv={args=3, base=1}, + indent={args=1, base=1}, index={args={2, 4}, base=1}, - input={args={1, 3}}, - inputdialog={args={1, 3}}, - inputlist={args=1}, + input={args={1, 3}, base=1}, + inputdialog={args={1, 3}, base=1}, + inputlist={args=1, base=1}, inputrestore={}, inputsave={}, - inputsecret={args={1, 2}}, + inputsecret={args={1, 2}, base=1}, insert={args={2, 3}, base=1}, interrupt={args=0}, invert={args=1, base=1}, - isdirectory={args=1}, + isdirectory={args=1, base=1}, isinf={args=1, base=1}, - islocked={args=1}, + islocked={args=1, base=1}, isnan={args=1, base=1}, id={args=1}, items={args=1, base=1}, -- cgit From 86593beaa40035a10a664d3147327a01f4885cb7 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Tue, 31 Aug 2021 23:49:43 +0100 Subject: feat(eval/method): partially port v8.1.1954 Does not include listener_*() functions. js_*() functions are N/A. json_encode() and json_decode() didn't include tests; add some anyway (to json_functions_spec.lua). test_lua.vim isn't included yet, so add tests to luaeval_spec.lua. --- src/nvim/eval.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index f600b4ce06..572e32e5a7 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -220,21 +220,21 @@ return { jobstop={args=1}, jobwait={args={1, 2}}, join={args={1, 2}, base=1}, - json_decode={args=1}, - json_encode={args=1}, + json_decode={args=1, base=1}, + json_encode={args=1, base=1}, keys={args=1, base=1}, last_buffer_nr={}, -- obsolete len={args=1, base=1}, - libcall={args=3}, - libcallnr={args=3}, - line={args={1, 2}}, - line2byte={args=1}, - lispindent={args=1}, - list2str={args={1, 2}}, + libcall={args=3, base=3}, + libcallnr={args=3, base=3}, + line={args={1, 2}, base=1}, + line2byte={args=1, base=1}, + lispindent={args=1, base=1}, + list2str={args={1, 2}, base=1}, localtime={}, 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}}, + luaeval={args={1, 2}, base=1}, map={args=2, base=1}, maparg={args={1, 4}}, mapcheck={args={1, 3}}, -- cgit From d23d37b212d7b47ae1f729de5e0ea46b456ad2e5 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Wed, 1 Sep 2021 12:02:56 +0100 Subject: vim-patch:8.1.1961: more functions can be used as a method Problem: More functions can be used as a method. Solution: Allow more functions to be used as a method. Add a test for mapcheck(). https://github.com/vim/vim/commit/a1449836334355b1fb00cd1bf083e7d353f6c4d7 mzeval() (if_mzscheme) is N/A. --- src/nvim/eval.lua | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 572e32e5a7..854bfd5f61 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -236,22 +236,22 @@ return { log10={args=1, base=1, func="float_op_wrapper", data="&log10"}, luaeval={args={1, 2}, base=1}, map={args=2, base=1}, - maparg={args={1, 4}}, - mapcheck={args={1, 3}}, - match={args={2, 4}}, - matchadd={args={2, 5}}, - matchaddpos={args={2, 5}}, - matcharg={args=1}, - matchdelete={args={1, 2}}, - matchend={args={2, 4}}, - matchlist={args={2, 4}}, - matchstr={args={2, 4}}, - matchstrpos={args={2,4}}, + maparg={args={1, 4}, base=1}, + mapcheck={args={1, 3}, base=1}, + match={args={2, 4}, base=1}, + matchadd={args={2, 5}, base=1}, + matchaddpos={args={2, 5}, base=1}, + matcharg={args=1, base=1}, + matchdelete={args={1, 2}, base=1}, + matchend={args={2, 4}, base=1}, + matchlist={args={2, 4}, base=1}, + matchstr={args={2, 4}, base=1}, + matchstrpos={args={2,4}, base=1}, max={args=1, base=1}, menu_get={args={1, 2}}, min={args=1, base=1}, - mkdir={args={1, 3}}, - mode={args={0, 1}}, + mkdir={args={1, 3}, base=1}, + mode={args={0, 1}, base=1}, msgpackdump={args={1, 2}}, msgpackparse={args=1}, nextnonblank={args=1}, -- cgit From c5583df3c081e485b521570891dbdd16cd952a85 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Wed, 1 Sep 2021 12:28:16 +0100 Subject: vim-patch:8.1.1984: 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/3f4f3d8e7e6fc0494d00cfb75669a554c8e67c8b test_prompt_buffer.vim already had all the changes, except Test_prompt_garbage_collect(). --- 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 854bfd5f61..741b8547fe 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -254,23 +254,23 @@ return { mode={args={0, 1}, base=1}, msgpackdump={args={1, 2}}, msgpackparse={args=1}, - nextnonblank={args=1}, - nr2char={args={1, 2}}, + nextnonblank={args=1, base=1}, + nr2char={args={1, 2}, base=1}, ['or']={args=2, base=1}, - pathshorten={args=1}, + pathshorten={args=1, base=1}, pow={args=2, base=1}, - prevnonblank={args=1}, + prevnonblank={args=1, base=1}, printf={args=varargs(1), base=2}, prompt_getprompt={args=1}, - prompt_setcallback={args={2, 2}}, - prompt_setinterrupt={args={2, 2}}, - prompt_setprompt={args={2, 2}}, + prompt_setcallback={args={2, 2}, base=1}, + prompt_setinterrupt={args={2, 2}, base=1}, + prompt_setprompt={args={2, 2}, base=1}, pum_getpos={}, pumvisible={}, - py3eval={args=1}, - pyeval={args=1}, - pyxeval={args=1}, - perleval={args=1}, + py3eval={args=1, base=1}, + pyeval={args=1, base=1}, + pyxeval={args=1, base=1}, + perleval={args=1, base=1}, range={args={1, 3}}, readdir={args={1, 2}}, readfile={args={1, 3}}, -- cgit From a8504638cd2497b3bdd0daf27dcc50903e1e2bb9 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Wed, 1 Sep 2021 13:40:58 +0100 Subject: feat(eval/method): partially port v8.1.1987 Cannot be fully ported as the remote_*() functions from +clientserver are not yet ported. Include the test changes anyway. line()'s optional winid argument was already ported. (Wasn't added in this patch; this just adds documentation) --- src/nvim/eval.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 741b8547fe..70aa2bb1f8 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -271,25 +271,25 @@ return { pyeval={args=1, base=1}, pyxeval={args=1, base=1}, perleval={args=1, base=1}, - range={args={1, 3}}, - readdir={args={1, 2}}, - readfile={args={1, 3}}, + range={args={1, 3}, base=1}, + readdir={args={1, 2}, base=1}, + readfile={args={1, 3}, base=1}, reg_executing={}, reg_recording={}, - reltime={args={0, 2}}, - reltimefloat={args=1}, - reltimestr={args=1}, + reltime={args={0, 2}, base=1}, + reltimefloat={args=1, base=1}, + reltimestr={args=1, base=1}, remove={args={2, 3}, base=1}, - rename={args=2}, + rename={args=2, base=1}, ['repeat']={args=2, base=1}, - resolve={args=1}, + resolve={args=1, base=1}, reverse={args=1, base=1}, round={args=1, base=1, func="float_op_wrapper", data="&round"}, rpcnotify={args=varargs(2)}, rpcrequest={args=varargs(2)}, rpcstart={args={1, 2}}, rpcstop={args=1}, - rubyeval={args=1}, + rubyeval={args=1, base=1}, screenattr={args=2}, screenchar={args=2}, screenchars={args=2}, -- cgit