From 01dbf0951b25d582451a8e656731dcf3d9295a71 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Fri, 23 Jun 2017 09:56:35 +0200 Subject: api: implement object namespaces Namespaces is a lightweight concept that should be used to group objects for purposes of bulk operations and introspection. This is initially used for highlights and virtual text in buffers, and is planned to also be used for extended marks. There is no plan use them for privileges or isolation, neither to introduce nanespace-level options. --- test/functional/api/vim_spec.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index a9d137391e..dde4dab7ac 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -1269,4 +1269,16 @@ describe('API', function() end) end) + describe('nvim_create_namespace', function() + it('works', function() + eq({}, meths.get_namespaces()) + eq(1, meths.create_namespace("ns-1")) + eq(2, meths.create_namespace("ns-2")) + eq(1, meths.create_namespace("ns-1")) + eq({["ns-1"]=1, ["ns-2"]=2}, meths.get_namespaces()) + eq(3, meths.create_namespace("")) + eq(4, meths.create_namespace("")) + eq({["ns-1"]=1, ["ns-2"]=2}, meths.get_namespaces()) + end) + end) end) -- cgit