diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2023-03-15 08:56:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-15 05:56:13 -0700 |
commit | 210120dde81ec289ae01e1d247df08f0b147c08a (patch) | |
tree | e97b7cd1f8d1ed1bbafc4f443b29dd146817bd49 /test/functional/lua/vim_spec.lua | |
parent | 21eacbfef399f124e9d50f1757c89453c4e02944 (diff) | |
download | rneovim-210120dde81ec289ae01e1d247df08f0b147c08a.tar.gz rneovim-210120dde81ec289ae01e1d247df08f0b147c08a.tar.bz2 rneovim-210120dde81ec289ae01e1d247df08f0b147c08a.zip |
fix(lua): vim.deprecate() shows ":help deprecated" #22677
Problem:
vim.deprecate() shows ":help deprecated" for third-party plugins. ":help
deprecated" only describes deprecations in Nvim, and is unrelated to any
3rd party deprecations.
Solution:
If `plugin` is specified, don't show ":help deprecated".
fix #22235
Diffstat (limited to 'test/functional/lua/vim_spec.lua')
-rw-r--r-- | test/functional/lua/vim_spec.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua index 470102df5e..0483ec46f0 100644 --- a/test/functional/lua/vim_spec.lua +++ b/test/functional/lua/vim_spec.lua @@ -127,6 +127,22 @@ describe('lua stdlib', function() eq(1, funcs.luaeval('vim.stricmp("\\0C\\0", "\\0B\\0")')) end) + it('vim.deprecate', function() + -- vim.deprecate(name, alternative, version, plugin, backtrace) + eq(dedent[[ + foo.bar() is deprecated, use zub.wooo{ok=yay} instead. :help deprecated + This feature will be removed in Nvim version 2.17]], + exec_lua('return vim.deprecate(...)', 'foo.bar()', 'zub.wooo{ok=yay}', '2.17')) + -- Same message, skipped. + eq(vim.NIL, + exec_lua('return vim.deprecate(...)', 'foo.bar()', 'zub.wooo{ok=yay}', '2.17')) + -- When `plugin` is specified, don't show ":help deprecated". #22235 + eq(dedent[[ + foo.bar() is deprecated, use zub.wooo{ok=yay} instead. + This feature will be removed in my-plugin.nvim version 0.3.0]], + exec_lua('return vim.deprecate(...)', 'foo.bar()', 'zub.wooo{ok=yay}', '0.3.0', 'my-plugin.nvim', false)) + end) + it('vim.startswith', function() eq(true, funcs.luaeval('vim.startswith("123", "1")')) eq(true, funcs.luaeval('vim.startswith("123", "")')) |