diff --git a/lua/navigator/util.lua b/lua/navigator/util.lua index 4101c94..1d6fc4d 100644 --- a/lua/navigator/util.lua +++ b/lua/navigator/util.lua @@ -380,11 +380,12 @@ function M.empty(t) end function M.encoding(client) - if type(client) ~= 'table' then - if client == nil then - client = 1 - end - client = vim.lsp.get_client_by_id(client) + if client == nil then + client = 1 + end + + if type(client) == 'number' then + client = vim.lsp.get_client_by_id(client) or {} end local oe = client.offset_encoding if oe == nil then