From 97c7646501d5cd6f57c57ce30acca89c5b8573ff Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 12 May 2024 23:12:25 +0200 Subject: refactor(api): nvim_win_xx_ns are EXPERIMENTAL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: The nvim_win_xx_ns function family introduced in ba0370b1d718d473d0ef51c35d88b98ba220082b needs more bake-time. Currently it's narrowly defined for windows, but other scopes ("buffer") and features are likely in the future. Solution: - Rename the API with double-underscore to mark it as EXPERIMENTAL. TODO/FUTURE: - Rename and change the signature to support more than just "window" scope, and for other flexibility. - Open question: we could choose either: - "store scopes on namespaces", or - "store namespaces on scopes (w:/b:/…)" --- test/functional/lua/highlight_spec.lua | 8 ++++---- test/functional/ui/decorations_spec.lua | 34 ++++++++++++++++----------------- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'test') diff --git a/test/functional/lua/highlight_spec.lua b/test/functional/lua/highlight_spec.lua index d47afa6164..c9f2d0a47f 100644 --- a/test/functional/lua/highlight_spec.lua +++ b/test/functional/lua/highlight_spec.lua @@ -43,9 +43,9 @@ 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)) + neq({}, api.nvim__win_get_ns(0)) command('wincmd w') - eq({}, api.nvim_win_get_ns(0)) + eq({}, api.nvim__win_get_ns(0)) end) it('removes old highlight if new one is created before old one times out', function() @@ -55,7 +55,7 @@ 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)) + neq({}, api.nvim__win_get_ns(0)) command('wincmd w') exec_lua([[ vim.api.nvim_buf_set_mark(0,"[",1,1,{}) @@ -63,6 +63,6 @@ describe('vim.highlight.on_yank', function() vim.highlight.on_yank({timeout = math.huge, on_macro = true, event = {operator = "y"}}) ]]) command('wincmd w') - eq({}, api.nvim_win_get_ns(0)) + eq({}, api.nvim__win_get_ns(0)) end) end) diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index d285e673e9..c3efcedc4b 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -5610,7 +5610,7 @@ describe('decorations: window scoped', function() screen:expect(noextmarks) - api.nvim_win_add_ns(0, ns) + api.nvim__win_add_ns(0, ns) screen:expect { grid = [[ @@ -5645,7 +5645,7 @@ describe('decorations: window scoped', function() screen:expect(noextmarks) - api.nvim_win_add_ns(0, ns) + api.nvim__win_add_ns(0, ns) screen:expect { grid = [[ @@ -5667,7 +5667,7 @@ describe('decorations: window scoped', function() screen:expect(noextmarks) - api.nvim_win_add_ns(0, ns) + api.nvim__win_add_ns(0, ns) screen:expect { grid = [[ @@ -5691,7 +5691,7 @@ describe('decorations: window scoped', function() screen:expect(noextmarks) - api.nvim_win_add_ns(0, ns) + api.nvim__win_add_ns(0, ns) screen:expect { grid = [[ @@ -5701,7 +5701,7 @@ describe('decorations: window scoped', function() | ]]} - api.nvim_win_del_ns(0, ns) + api.nvim__win_del_ns(0, ns) screen:expect(noextmarks) end) @@ -5716,7 +5716,7 @@ describe('decorations: window scoped', function() screen:expect(noextmarks) - api.nvim_win_add_ns(0, ns) + api.nvim__win_add_ns(0, ns) screen:expect { grid = [[ @@ -5748,7 +5748,7 @@ describe('decorations: window scoped', function() | ]]} - api.nvim_win_add_ns(0, ns) + api.nvim__win_add_ns(0, ns) screen:expect { grid = [[ @@ -5787,7 +5787,7 @@ describe('decorations: window scoped', function() | ]]} - api.nvim_win_add_ns(0, ns) + api.nvim__win_add_ns(0, ns) screen:expect { grid = [[ @@ -5815,7 +5815,7 @@ describe('decorations: window scoped', function() screen:expect(noextmarks) - api.nvim_win_add_ns(0, ns) + api.nvim__win_add_ns(0, ns) screen:expect { grid = [[ @@ -5836,7 +5836,7 @@ describe('decorations: window scoped', function() end_col = 3, }) - api.nvim_win_add_ns(0, ns) + api.nvim__win_add_ns(0, ns) screen:expect { grid = [[ @@ -5880,8 +5880,8 @@ describe('decorations: window scoped', function() end_col = 3, }) - eq(true, api.nvim_win_add_ns(0, ns)) - eq({ ns }, api.nvim_win_get_ns(0)) + eq(true, api.nvim__win_add_ns(0, ns)) + eq({ ns }, api.nvim__win_get_ns(0)) screen:expect { grid = [[ @@ -5892,12 +5892,12 @@ describe('decorations: window scoped', function() command 'split' command 'only' - eq({}, api.nvim_win_get_ns(0)) + eq({}, api.nvim__win_get_ns(0)) screen:expect(noextmarks) - eq(true, api.nvim_win_add_ns(0, ns)) - eq({ ns }, api.nvim_win_get_ns(0)) + eq(true, api.nvim__win_add_ns(0, ns)) + eq({ ns }, api.nvim__win_get_ns(0)) screen:expect { grid = [[ @@ -5906,8 +5906,8 @@ describe('decorations: window scoped', function() | ]]} - eq(true, api.nvim_win_del_ns(0, ns)) - eq({}, api.nvim_win_get_ns(0)) + eq(true, api.nvim__win_del_ns(0, ns)) + eq({}, api.nvim__win_get_ns(0)) screen:expect(noextmarks) end) -- cgit