From 87c7c83ce62971e0bdb29bb32b8ad2b19c8f95d0 Mon Sep 17 00:00:00 2001 From: glepnir Date: Fri, 15 Nov 2024 14:24:12 +0800 Subject: [PATCH] fix: fmt client id with name in complete of LspStop (#3436) Problem: client id and name are separated by spaces, which may cause misunderstanding. Solution: use colon combine as one thing. --- plugin/lspconfig.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/lspconfig.lua b/plugin/lspconfig.lua index 45fb87ae10..0e855649dc 100644 --- a/plugin/lspconfig.lua +++ b/plugin/lspconfig.lua @@ -30,7 +30,7 @@ end local lsp_get_active_client_ids = function(arg) local clients = vim.tbl_map(function(client) - return ('%d (%s)'):format(client.id, client.name) + return ('%d:%s'):format(client.id, client.name) end, util.get_managed_clients()) return completion_sort(vim.tbl_filter(function(s) @@ -81,7 +81,7 @@ api.nvim_create_user_command('LspRestart', function(info) detach_clients[client.name] = { client, lsp.get_buffers_by_client_id(client.id) } end end - local timer = vim.uv.new_timer() + local timer = assert(vim.uv.new_timer()) timer:start( 500, 100,