mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
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.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user