diff options
| author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-07-12 17:00:02 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-12 17:00:02 -0700 |
| commit | af7748a99dd1701ae83d3af0dd61c08769aeb2c8 (patch) | |
| tree | 7325fe98a2010ef82dac67246d2d36d3c7df7fe7 /lua | |
| parent | [docgen] Update CONFIG.md (diff) | |
| download | nvim-lspconfig-af7748a99dd1701ae83d3af0dd61c08769aeb2c8.tar nvim-lspconfig-af7748a99dd1701ae83d3af0dd61c08769aeb2c8.tar.gz nvim-lspconfig-af7748a99dd1701ae83d3af0dd61c08769aeb2c8.tar.bz2 nvim-lspconfig-af7748a99dd1701ae83d3af0dd61c08769aeb2c8.tar.lz nvim-lspconfig-af7748a99dd1701ae83d3af0dd61c08769aeb2c8.tar.xz nvim-lspconfig-af7748a99dd1701ae83d3af0dd61c08769aeb2c8.tar.zst nvim-lspconfig-af7748a99dd1701ae83d3af0dd61c08769aeb2c8.zip | |
fix: do not attach server if buftype is 'nofile' (#1064)
* match buftype instead of filetype against 'nofile'
* clarify variable naming to make buffer filetype clear from buftype
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/configs.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lua/lspconfig/configs.lua b/lua/lspconfig/configs.lua index d004d08c..28202df6 100644 --- a/lua/lspconfig/configs.lua +++ b/lua/lspconfig/configs.lua @@ -161,7 +161,7 @@ function configs.__newindex(t, config_name, config_def) function manager.try_add(bufnr) bufnr = bufnr or api.nvim_get_current_buf() - if vim.api.nvim_buf_get_option(bufnr, "filetype") == "nofile" then + if vim.api.nvim_buf_get_option(bufnr, "buftype") == "nofile" then return end local root_dir = get_root_dir(api.nvim_buf_get_name(bufnr), bufnr) @@ -172,9 +172,9 @@ function configs.__newindex(t, config_name, config_def) end function manager.try_add_wrapper(bufnr) - local buftype = vim.api.nvim_buf_get_option(bufnr, "filetype") + local buf_filetype = vim.api.nvim_buf_get_option(bufnr, "filetype") for _, filetype in ipairs(config.filetypes) do - if buftype == filetype then + if buf_filetype == filetype then manager.try_add(bufnr) return end |
