diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-04-03 13:08:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-03 13:08:28 +0200 |
commit | f28da92b46090051ce83e642098562faf1693154 (patch) | |
tree | 333d0df17eea9e0d4816cf128becdea0a15307e4 /test/functional/lua/inspector_spec.lua | |
parent | f4cbe0360651123d7f33ddbaa046f797c7d73671 (diff) | |
parent | a93024555720325ecede9d2d15e4bd0f1fd82739 (diff) | |
download | rneovim-f28da92b46090051ce83e642098562faf1693154.tar.gz rneovim-f28da92b46090051ce83e642098562faf1693154.tar.bz2 rneovim-f28da92b46090051ce83e642098562faf1693154.zip |
Merge pull request #22783 from luukvbaal/inspect
refactor(lua): get all extmarks instead of iterating over namespaces
Diffstat (limited to 'test/functional/lua/inspector_spec.lua')
-rw-r--r-- | test/functional/lua/inspector_spec.lua | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/test/functional/lua/inspector_spec.lua b/test/functional/lua/inspector_spec.lua index 5e488bb082..edc0519471 100644 --- a/test/functional/lua/inspector_spec.lua +++ b/test/functional/lua/inspector_spec.lua @@ -12,9 +12,13 @@ describe('vim.inspect_pos', function() it('it returns items', function() local ret = exec_lua([[ local buf = vim.api.nvim_create_buf(true, false) + local ns1 = vim.api.nvim_create_namespace("ns1") + local ns2 = vim.api.nvim_create_namespace("") vim.api.nvim_set_current_buf(buf) vim.api.nvim_buf_set_lines(0, 0, -1, false, {"local a = 123"}) vim.api.nvim_buf_set_option(buf, "filetype", "lua") + vim.api.nvim_buf_set_extmark(buf, ns1, 0, 10, { hl_group = "Normal" }) + vim.api.nvim_buf_set_extmark(buf, ns2, 0, 10, { hl_group = "Normal" }) vim.cmd("syntax on") return {buf, vim.inspect_pos(0, 0, 10)} ]]) @@ -24,7 +28,42 @@ describe('vim.inspect_pos', function() buffer = buf, col = 10, row = 0, - extmarks = {}, + extmarks = { + { + col = 10, + end_col = 11, + end_row = 0, + id = 1, + ns = 'ns1', + ns_id = 1, + opts = { + hl_eol = false, + hl_group = 'Normal', + hl_group_link = 'Normal', + ns_id = 1, + priority = 4096, + right_gravity = true + }, + row = 0 + }, + { + col = 10, + end_col = 11, + end_row = 0, + id = 1, + ns = '', + ns_id = 2, + opts = { + hl_eol = false, + hl_group = 'Normal', + hl_group_link = 'Normal', + ns_id = 2, + priority = 4096, + right_gravity = true + }, + row = 0 + } + }, treesitter = {}, semantic_tokens = {}, syntax = { |