From d6a6eed4f3bccd676e8c3f92be89b4f0d96fc0b0 Mon Sep 17 00:00:00 2001 From: Barrett Ruth <62671086+barrettruth@users.noreply.github.com> Date: Mon, 23 Mar 2026 07:30:35 -0400 Subject: [PATCH] feat(lsp): attach to buftype=help buffers #38412 Problem: `vim.lsp.enable()` skips all buffers with non-empty `buftype`, including `help` buffers. LSPs targeting `filetype='help'` never auto-attach despite help buffers being real files. Solution: Expand the `buftype` guard in `lsp_enable_callback` to allow `help` alongside `""`. --- runtime/lua/vim/lsp.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index 184a784faa..9a956b7b51 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -520,8 +520,8 @@ end --- @param bufnr integer local function lsp_enable_callback(bufnr) - -- Only ever attach to buffers that represent an actual file. - if vim.bo[bufnr].buftype ~= '' then + -- Only ever attach to buffers (including "help") that represent an actual file. + if vim.bo[bufnr].buftype ~= '' and vim.bo[bufnr].buftype ~= 'help' then return end