We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e0c03d commit b20f595Copy full SHA for b20f595
lua/copilot/setup.lua
@@ -2,9 +2,17 @@ local M = {}
2
3
local function find_config_path()
4
local config = vim.fn.expand('$XDG_CONFIG_HOME')
5
- if config and config ~= '' then return config end
6
- config = vim.fn.has('win32') and vim.fn.expand('~/AppData/Local') or nil
7
- return config or vim.fn.expand('~/.config')
+ if config and vim.fn.isdirectory(config) > 0 then
+ return config
+ elseif vim.fn.has('win32') > 0 then
8
+ config = vim.fn.expand('~/AppData/Local')
9
+ if vim.fn.isdirectory(config) > 0 then return config end
10
+ else
11
+ config = vim.fn.expand('~/.config')
12
+ if vim.fn.isdirectory(config) > 0 then return config
13
+ else print("Error: could not find config path")
14
+ end
15
16
end
17
18
0 commit comments