From 54e1755b93c69cc20dfe1fd05dbde7df91b514bc Mon Sep 17 00:00:00 2001 From: beardedsakimonkey <54521218+beardedsakimonkey@users.noreply.github.com> Date: Sun, 19 Jul 2020 16:12:55 -0700 Subject: [RFC] don't start up LSP for 'nofile' buffers high level goal is to allow users some way to set filetype for a buffer in cases where they don't want to start up an LSP server, e.g. in a fuzzy finder preview --- lua/nvim_lsp/configs.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lua') diff --git a/lua/nvim_lsp/configs.lua b/lua/nvim_lsp/configs.lua index 48b5b6ee..8bbc6082 100644 --- a/lua/nvim_lsp/configs.lua +++ b/lua/nvim_lsp/configs.lua @@ -171,6 +171,9 @@ function configs.__newindex(t, config_name, config_def) end) function manager.try_add() + if vim.bo.buftype == 'nofile' then + return + end local root_dir = get_root_dir(api.nvim_buf_get_name(0), api.nvim_get_current_buf()) local id = manager.add(root_dir) if id then -- cgit v1.2.3-70-g09d2