diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-01-29 11:45:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-29 11:45:15 +0100 |
commit | cf4d025c5a17734cbd4513ea7136ec7fbb95436e (patch) | |
tree | ccdb4a124ed9b997e003fb9d920d56f8789029ce | |
parent | 8fc9a58256e1865f29bfe6e3ba7a778ee91adb21 (diff) | |
parent | fb8cd340dcd102773f0651c75436271fcab721d4 (diff) | |
download | rneovim-cf4d025c5a17734cbd4513ea7136ec7fbb95436e.tar.gz rneovim-cf4d025c5a17734cbd4513ea7136ec7fbb95436e.tar.bz2 rneovim-cf4d025c5a17734cbd4513ea7136ec7fbb95436e.zip |
Merge pull request #17209 from bb010g/patch-1
fix(eval): v:lua support for `-` in module names
-rw-r--r-- | src/nvim/eval.c | 2 | ||||
-rw-r--r-- | test/functional/fixtures/pack/foo/start/bar/lua/baz-quux.lua | 1 | ||||
-rw-r--r-- | test/functional/lua/luaeval_spec.lua | 1 |
3 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d25903c12a..40fa05da4f 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -8956,7 +8956,7 @@ static bool tv_is_luafunc(typval_T *tv) const char *skip_luafunc_name(const char *p) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { - while (ASCII_ISALNUM(*p) || *p == '_' || *p == '.' || *p == '\'') { + while (ASCII_ISALNUM(*p) || *p == '_' || *p == '-' || *p == '.' || *p == '\'') { p++; } return p; diff --git a/test/functional/fixtures/pack/foo/start/bar/lua/baz-quux.lua b/test/functional/fixtures/pack/foo/start/bar/lua/baz-quux.lua new file mode 100644 index 0000000000..c1c33d787e --- /dev/null +++ b/test/functional/fixtures/pack/foo/start/bar/lua/baz-quux.lua @@ -0,0 +1 @@ +return {doit=function() return 9004 end} diff --git a/test/functional/lua/luaeval_spec.lua b/test/functional/lua/luaeval_spec.lua index c543dd1995..1322155595 100644 --- a/test/functional/lua/luaeval_spec.lua +++ b/test/functional/lua/luaeval_spec.lua @@ -532,6 +532,7 @@ describe('v:lua', function() command('set pp+=test/functional/fixtures') eq('\tbadval', eval("v:lua.require'leftpad'('badval')")) eq(9003, eval("v:lua.require'bar'.doit()")) + eq(9004, eval("v:lua.require'baz-quux'.doit()")) end) it('throw errors for invalid use', function() |