From e52c25b7617ac6401b080f76b0e227161dfef230 Mon Sep 17 00:00:00 2001 From: Maria José Solano Date: Sat, 2 Mar 2024 13:11:23 -0800 Subject: feat(lua): deprecate vim.tbl_add_reverse_lookup --- runtime/lua/tohtml.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'runtime/lua/tohtml.lua') diff --git a/runtime/lua/tohtml.lua b/runtime/lua/tohtml.lua index 68fef38c64..505de720ba 100644 --- a/runtime/lua/tohtml.lua +++ b/runtime/lua/tohtml.lua @@ -575,7 +575,10 @@ local function styletable_extmarks(state) --TODO(altermo) extmarks may have col/row which is outside of the buffer, which could cause an error local bufnr = state.bufnr local extmarks = vim.api.nvim_buf_get_extmarks(bufnr, -1, 0, -1, { details = true }) - local namespaces = vim.tbl_add_reverse_lookup(vim.api.nvim_get_namespaces()) + local namespaces = {} --- @type table + for ns, ns_id in pairs(vim.api.nvim_get_namespaces()) do + namespaces[ns_id] = ns + end for _, v in ipairs(extmarks) do _styletable_extmarks_highlight(state, v, namespaces) end -- cgit