From 31f2f920e1249f350f5831f918f8a91d8a41ba68 Mon Sep 17 00:00:00 2001 From: ray-x Date: Sat, 16 Apr 2022 21:51:52 +1000 Subject: [PATCH] lsp encoding default value --- lua/navigator/util.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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