diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2022-01-06 11:10:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-06 11:10:56 -0700 |
commit | d78e46679d2ff31916091f9368367ccc1539c299 (patch) | |
tree | eab41e8ecf863638324ed85769df5c42451f1fce /test/functional/lua/vim_spec.lua | |
parent | 2f779e33615d41e4472b3705e68ef9465b5f5d4e (diff) | |
download | rneovim-d78e46679d2ff31916091f9368367ccc1539c299.tar.gz rneovim-d78e46679d2ff31916091f9368367ccc1539c299.tar.bz2 rneovim-d78e46679d2ff31916091f9368367ccc1539c299.zip |
feat(lua): add notify_once() (#16956)
Like vim.notify(), but only displays the notification once.
Diffstat (limited to 'test/functional/lua/vim_spec.lua')
-rw-r--r-- | test/functional/lua/vim_spec.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua index 53c1de7b01..642dc59bbc 100644 --- a/test/functional/lua/vim_spec.lua +++ b/test/functional/lua/vim_spec.lua @@ -2203,6 +2203,40 @@ describe('lua stdlib', function() end) end) + it('vim.notify_once', function() + local screen = Screen.new(60,5) + screen:set_default_attr_ids({ + [0] = {bold=true, foreground=Screen.colors.Blue}, + [1] = {foreground=Screen.colors.Red}, + }) + screen:attach() + screen:expect{grid=[[ + ^ | + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]} + exec_lua [[vim.notify_once("I'll only tell you this once...", vim.log.levels.WARN)]] + screen:expect{grid=[[ + ^ | + {0:~ }| + {0:~ }| + {0:~ }| + {1:I'll only tell you this once...} | + ]]} + feed('<C-l>') + screen:expect{grid=[[ + ^ | + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]} + exec_lua [[vim.notify_once("I'll only tell you this once...")]] + screen:expect_unchanged() + end) + describe('vim.schedule_wrap', function() it('preserves argument lists', function() exec_lua [[ |