aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/highlight_spec.lua
diff options
context:
space:
mode:
authoraltermo <107814000+altermo@users.noreply.github.com>2024-06-07 17:33:40 +0200
committerGitHub <noreply@github.com>2024-06-07 08:33:40 -0700
commitf3632e14e3a75114415050ab01c2d04a06036009 (patch)
treeb3a7067d7cbde9305b01324384a0aac76e6a56ae /test/functional/lua/highlight_spec.lua
parent2ce4a4d91e4abee0aab8b98c47eea9fbd4849ba6 (diff)
downloadrneovim-f3632e14e3a75114415050ab01c2d04a06036009.tar.gz
rneovim-f3632e14e3a75114415050ab01c2d04a06036009.tar.bz2
rneovim-f3632e14e3a75114415050ab01c2d04a06036009.zip
feat: get/set namespace properties #28728
ref https://github.com/neovim/neovim/pull/28432 ref https://github.com/neovim/neovim/issues/28469
Diffstat (limited to 'test/functional/lua/highlight_spec.lua')
-rw-r--r--test/functional/lua/highlight_spec.lua14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/functional/lua/highlight_spec.lua b/test/functional/lua/highlight_spec.lua
index 66095121b0..ad709a06f1 100644
--- a/test/functional/lua/highlight_spec.lua
+++ b/test/functional/lua/highlight_spec.lua
@@ -4,7 +4,6 @@ local Screen = require('test.functional.ui.screen')
local exec_lua = n.exec_lua
local eq = t.eq
-local neq = t.neq
local eval = n.eval
local command = n.command
local clear = n.clear
@@ -142,9 +141,11 @@ describe('vim.highlight.on_yank', function()
vim.api.nvim_buf_set_mark(0,"]",1,1,{})
vim.highlight.on_yank({timeout = math.huge, on_macro = true, event = {operator = "y"}})
]])
- neq({}, api.nvim__win_get_ns(0))
+ local ns = api.nvim_create_namespace('hlyank')
+ local win = api.nvim_get_current_win()
+ eq({ win }, api.nvim__ns_get(ns).wins)
command('wincmd w')
- eq({}, api.nvim__win_get_ns(0))
+ eq({ win }, api.nvim__ns_get(ns).wins)
end)
it('removes old highlight if new one is created before old one times out', function()
@@ -154,14 +155,17 @@ describe('vim.highlight.on_yank', function()
vim.api.nvim_buf_set_mark(0,"]",1,1,{})
vim.highlight.on_yank({timeout = math.huge, on_macro = true, event = {operator = "y"}})
]])
- neq({}, api.nvim__win_get_ns(0))
+ local ns = api.nvim_create_namespace('hlyank')
+ eq(api.nvim_get_current_win(), api.nvim__ns_get(ns).wins[1])
command('wincmd w')
exec_lua([[
vim.api.nvim_buf_set_mark(0,"[",1,1,{})
vim.api.nvim_buf_set_mark(0,"]",1,1,{})
vim.highlight.on_yank({timeout = math.huge, on_macro = true, event = {operator = "y"}})
]])
+ local win = api.nvim_get_current_win()
+ eq({ win }, api.nvim__ns_get(ns).wins)
command('wincmd w')
- eq({}, api.nvim__win_get_ns(0))
+ eq({ win }, api.nvim__ns_get(ns).wins)
end)
end)