diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2017-06-23 09:56:35 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2018-11-24 11:01:37 +0100 |
commit | 01dbf0951b25d582451a8e656731dcf3d9295a71 (patch) | |
tree | 40d9b5b3fee2829baf8c3ab5fa38cf8d0629d7ce /test/functional/api/vim_spec.lua | |
parent | 108566e7b6f1b331dac8e339280c230bf39c137d (diff) | |
download | rneovim-01dbf0951b25d582451a8e656731dcf3d9295a71.tar.gz rneovim-01dbf0951b25d582451a8e656731dcf3d9295a71.tar.bz2 rneovim-01dbf0951b25d582451a8e656731dcf3d9295a71.zip |
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.
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 12 |
1 files changed, 12 insertions, 0 deletions
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) |