aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorzc he <blindfs19@gmail.com>2025-02-10 10:22:23 +0800
committerGitHub <noreply@github.com>2025-02-09 18:22:23 -0800
commitd37812c49063eda10ad1f7c7695509365ac7bd47 (patch)
tree83c4009a2d44b6672a10e17a59581bee7bd345aa /lua
parentdocs: update configs.md (diff)
downloadnvim-lspconfig-d37812c49063eda10ad1f7c7695509365ac7bd47.tar
nvim-lspconfig-d37812c49063eda10ad1f7c7695509365ac7bd47.tar.gz
nvim-lspconfig-d37812c49063eda10ad1f7c7695509365ac7bd47.tar.bz2
nvim-lspconfig-d37812c49063eda10ad1f7c7695509365ac7bd47.tar.lz
nvim-lspconfig-d37812c49063eda10ad1f7c7695509365ac7bd47.tar.xz
nvim-lspconfig-d37812c49063eda10ad1f7c7695509365ac7bd47.tar.zst
nvim-lspconfig-d37812c49063eda10ad1f7c7695509365ac7bd47.zip
fix(nushell): avoid nil root_dir #3611
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/configs/nushell.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/lspconfig/configs/nushell.lua b/lua/lspconfig/configs/nushell.lua
index a51f452e..9b51a021 100644
--- a/lua/lspconfig/configs/nushell.lua
+++ b/lua/lspconfig/configs/nushell.lua
@@ -3,7 +3,7 @@ return {
cmd = { 'nu', '--lsp' },
filetypes = { 'nu' },
root_dir = function(fname)
- return vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1])
+ return vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1] or fname)
end,
single_file_support = true,
},