diff options
| author | glepnir <glephunter@gmail.com> | 2025-06-02 06:03:35 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-01 15:03:35 -0700 |
| commit | 5cfbc35aa8381f3e199be248fbb94b05c16f82ff (patch) | |
| tree | 3c000e09611e0b4fd1e37574904343a46a38df88 /test/functional/api/command_spec.lua | |
| parent | 80753332d1fe8035b54d1bd8936e222801620c36 (diff) | |
| download | rneovim-5cfbc35aa8381f3e199be248fbb94b05c16f82ff.tar.gz rneovim-5cfbc35aa8381f3e199be248fbb94b05c16f82ff.tar.bz2 rneovim-5cfbc35aa8381f3e199be248fbb94b05c16f82ff.zip | |
fix(api): add missing nargs field to user command Lua callbacks #34210
Problem: nvim_create_user_command() Lua callbacks were missing the documented nargs field in the options table passed to the callback function.
Solution: Add nargs field derivation from command argument type flags in nlua_do_ucmd(), using the same logic as nvim_parse_cmd().
Diffstat (limited to 'test/functional/api/command_spec.lua')
| -rw-r--r-- | test/functional/api/command_spec.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/api/command_spec.lua b/test/functional/api/command_spec.lua index 49b26ab521..cc09178834 100644 --- a/test/functional/api/command_spec.lua +++ b/test/functional/api/command_spec.lua @@ -227,6 +227,7 @@ describe('nvim_create_user_command', function() line1 = 1, line2 = 1, mods = '', + nargs = '*', smods = { browse = false, confirm = false, @@ -267,6 +268,7 @@ describe('nvim_create_user_command', function() line1 = 1, line2 = 1, mods = '', + nargs = '*', smods = { browse = false, confirm = false, @@ -307,6 +309,7 @@ describe('nvim_create_user_command', function() line1 = 1, line2 = 1, mods = '', + nargs = '*', smods = { browse = false, confirm = false, @@ -347,6 +350,7 @@ describe('nvim_create_user_command', function() line1 = 10, line2 = 10, mods = 'confirm unsilent botright horizontal', + nargs = '*', smods = { browse = false, confirm = true, @@ -387,6 +391,7 @@ describe('nvim_create_user_command', function() line1 = 1, line2 = 42, mods = '', + nargs = '*', smods = { browse = false, confirm = false, @@ -427,6 +432,7 @@ describe('nvim_create_user_command', function() line1 = 1, line2 = 1, mods = '', + nargs = '*', smods = { browse = false, confirm = false, @@ -479,6 +485,7 @@ describe('nvim_create_user_command', function() line1 = 1, line2 = 1, mods = '', + nargs = '?', smods = { browse = false, confirm = false, @@ -520,6 +527,7 @@ describe('nvim_create_user_command', function() line1 = 1, line2 = 1, mods = '', + nargs = '?', smods = { browse = false, confirm = false, @@ -572,6 +580,7 @@ describe('nvim_create_user_command', function() line1 = 1, line2 = 1, mods = '', + nargs = '0', smods = { browse = false, confirm = false, @@ -612,6 +621,7 @@ describe('nvim_create_user_command', function() line1 = 1, line2 = 1, mods = '', + nargs = '0', smods = { browse = false, confirm = false, |