From 8fce7d2fd0ac56c87cabf049e0c4f32191ade0ec Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Fri, 11 Apr 2025 23:54:40 -0600 Subject: Fix the problem with LSP and code formatting. Sometimes the LSP list wouldn't appear as a list and so it would default to the external-program formatter instead of the lsp formatter. --- init.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.vim b/init.vim index 3b4c141..bca3c9d 100644 --- a/init.vim +++ b/init.vim @@ -329,6 +329,8 @@ noremap <3-X1Mouse> noremap +noremap Telescope tags + menu 0.400 PopUp.Find\ References norm g[r menu 0.400 PopUp.Find\ Implementers norm g[i menu PopUp.Split :split @@ -490,7 +492,7 @@ lua << EOF function run_format_code() local lsps = vim.lsp.buf_get_clients() - if lsps and #lsps > 0 then + if lsps then vim.lsp.buf.format() else vim.cmd("FormatCode") -- cgit