aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/tohtml.lua
diff options
context:
space:
mode:
authorMaria José Solano <majosolano99@gmail.com>2024-03-02 13:11:23 -0800
committerChristian Clason <c.clason@uni-graz.at>2024-03-07 10:24:34 +0100
commite52c25b7617ac6401b080f76b0e227161dfef230 (patch)
tree5ba26232e1d7ef539ae727514f588e8515f4ff9e /runtime/lua/tohtml.lua
parent6525832a8c4d44a8ebabba02a5ea1ce09b389a4f (diff)
downloadrneovim-e52c25b7617ac6401b080f76b0e227161dfef230.tar.gz
rneovim-e52c25b7617ac6401b080f76b0e227161dfef230.tar.bz2
rneovim-e52c25b7617ac6401b080f76b0e227161dfef230.zip
feat(lua): deprecate vim.tbl_add_reverse_lookup
Diffstat (limited to 'runtime/lua/tohtml.lua')
-rw-r--r--runtime/lua/tohtml.lua5
1 files changed, 4 insertions, 1 deletions
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<integer, string>
+ 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