[vim/vim] Port the support for accessing Vim variable dictionaries in Lua scripts from NeoVim (#8693)

36 views
Skip to first unread message

Yegappan Lakshmanan

unread,
Aug 3, 2021, 12:04:23 AM8/3/21
to vim/vim, Subscribed

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/8693

Commit Summary

  • Port support for accessing Vim variable dictionaries (v:, g:, w:, b:, t:) in Lua scripts from NeoVim

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

codecov[bot]

unread,
Aug 3, 2021, 12:11:41 AM8/3/21
to vim/vim, Subscribed

Codecov Report

Merging #8693 (2d76339) into master (2c70711) will decrease coverage by 87.65%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff             @@

##           master    #8693       +/-   ##

===========================================

- Coverage   90.11%    2.46%   -87.66%     

===========================================

  Files         150      148        -2     

  Lines      170300   165123     -5177     

===========================================

- Hits       153473     4072   -149401     

- Misses      16827   161051   +144224     
Flag Coverage Δ
huge-clang-none ?
huge-gcc-none ?
huge-gcc-testgui ?
huge-gcc-unittests 2.46% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/if_lua.c 0.00% <0.00%> (-93.31%) ⬇️
src/window.c 3.96% <ø> (-88.82%) ⬇️
src/float.c 0.00% <0.00%> (-99.16%) ⬇️
src/gui_gtk_f.c 0.00% <0.00%> (-97.54%) ⬇️
src/sound.c 0.00% <0.00%> (-97.12%) ⬇️
src/crypt_zip.c 0.00% <0.00%> (-97.06%) ⬇️
src/match.c 0.00% <0.00%> (-96.98%) ⬇️
src/sha256.c 0.00% <0.00%> (-96.94%) ⬇️
src/evalbuffer.c 0.00% <0.00%> (-96.92%) ⬇️
src/textprop.c 0.00% <0.00%> (-96.82%) ⬇️
... and 138 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c70711...2d76339. Read the comment docs.

Bram Moolenaar

unread,
Aug 3, 2021, 12:59:18 PM8/3/21
to vim/vim, Subscribed

This passes on CI, but in my local setup it fails:
Found errors in Test_lua_global_var_table():
Caught exception in Test_lua_global_var_table(): Vim(lua):[string "vim chunk"]:1: bad argument #1 to 'remove' (table expected, got userdata) @ command line..script /home/mool/vim/vim82/src/testdir/runtest.vim[473]..function RunTheTest[44]..Test_lua_global_var_table, line 51
Found errors in Test_lua_predefined_var_table():
command line..script /home/mool/vim/vim82/src/testdir/runtest.vim[473]..function RunTheTest[44]..Test_lua_predefined_var_table line 12: Expected 'list is locked' but got '[string "vim chunk"]:1: bad argument #1 to ''remove'' (table expected, got userdata)': lua table.remove(vim.v.argv, 1)
SKIPPED Test_lua_list_table_insert_remove(): Lua version < 5.3

I suppose that is because of the Lua version being 5.2.

Yegappan Lakshmanan

unread,
Aug 4, 2021, 12:47:30 AM8/4/21
to vim/vim, Push

@yegappan pushed 1 commit.

  • 157ac57 Fix test failures with lua 5.2


You are receiving this because you are subscribed to this thread.

View it on GitHub or unsubscribe.

Yegappan Lakshmanan

unread,
Aug 4, 2021, 12:50:02 AM8/4/21
to vim_dev, reply+ACY5DGGICWGKRGYGFP...@reply.github.com, vim/vim, Subscribed
Hi Bram,

On Tue, Aug 3, 2021 at 9:59 AM Bram Moolenaar <vim-dev...@256bit.org> wrote:

This passes on CI, but in my local setup it fails:
Found errors in Test_lua_global_var_table():
Caught exception in Test_lua_global_var_table(): Vim(lua):[string "vim chunk"]:1: bad argument #1 to 'remove' (table expected, got userdata) @ command line..script /home/mool/vim/vim82/src/testdir/runtest.vim[473]..function RunTheTest[44]..Test_lua_global_var_table, line 51
Found errors in Test_lua_predefined_var_table():
command line..script /home/mool/vim/vim82/src/testdir/runtest.vim[473]..function RunTheTest[44]..Test_lua_predefined_var_table line 12: Expected 'list is locked' but got '[string "vim chunk"]:1: bad argument #1 to ''remove'' (table expected, got userdata)': lua table.remove(vim.v.argv, 1)
SKIPPED Test_lua_list_table_insert_remove(): Lua version < 5.3

I suppose that is because of the Lua version being 5.2.



Yes. The Lua 5.3 release notes mention that the table library
was enhanced to use metamethods for setting and getting elements.
I have updated the test to not use the table API for adding and
removing elements from the Vim dictionary.

- Yegappan

vim-dev ML

unread,
Aug 4, 2021, 12:50:21 AM8/4/21
to vim/vim, vim-dev ML, Your activity

Hi Bram,

On Tue, Aug 3, 2021 at 9:59 AM Bram Moolenaar ***@***.***>

wrote:

> This passes on CI, but in my local setup it fails:
> Found errors in Test_lua_global_var_table():
> Caught exception in Test_lua_global_var_table(): Vim(lua):[string "vim
> chunk"]:1: bad argument #1 <https://github.com/vim/vim/issues/1> to

> 'remove' (table expected, got userdata) @ command line..script
> /home/mool/vim/vim82/src/testdir/runtest.vim[473]..function
> RunTheTest[44]..Test_lua_global_var_table, line 51
> Found errors in Test_lua_predefined_var_table():
> command line..script
> /home/mool/vim/vim82/src/testdir/runtest.vim[473]..function
> RunTheTest[44]..Test_lua_predefined_var_table line 12: Expected 'list is
> locked' but got '[string "vim chunk"]:1: bad argument #1
> <https://github.com/vim/vim/issues/1> to ''remove'' (table expected, got

> userdata)': lua table.remove(vim.v.argv, 1)
> SKIPPED Test_lua_list_table_insert_remove(): Lua version < 5.3
>
> I suppose that is because of the Lua version being 5.2.
>
>
>
Yes. The Lua 5.3 release notes mention that the table library
was enhanced to use metamethods for setting and getting elements.
I have updated the test to not use the table API for adding and
removing elements from the Vim dictionary.

- Yegappan

Bram Moolenaar

unread,
Aug 4, 2021, 3:13:17 PM8/4/21
to vim/vim, vim-dev ML, Comment

Closed #8693 via 9dc4bef.


You are receiving this because you commented.

Reply all
Reply to author
Forward
0 new messages