feat(lua): deprecate vim.tbl_add_reverse_lookup

This commit is contained in:
Maria José Solano
2024-03-02 13:11:23 -08:00
committed by Christian Clason
parent 6525832a8c
commit e52c25b761
9 changed files with 66 additions and 68 deletions

View File

@@ -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