Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use $LOCALAPPDATA when loading github token #410

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions lua/CopilotChat/copilot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,17 @@ local function find_config_path()
local config = vim.fn.expand('$XDG_CONFIG_HOME')
if config and vim.fn.isdirectory(config) > 0 then
return config
elseif vim.fn.has('win32') > 0 then
config = vim.fn.expand('~/AppData/Local')
if vim.fn.isdirectory(config) > 0 then
return config
end
if vim.fn.has('win32') > 0 then
config = vim.fn.expand('$LOCALAPPDATA')
if not config or vim.fn.isdirectory(config) == 0 then
config = vim.fn.expand('$HOME/AppData/Local')
end
else
config = vim.fn.expand('~/.config')
if vim.fn.isdirectory(config) > 0 then
return config
end
config = vim.fn.expand('$HOME/.config')
end
if config and vim.fn.isdirectory(config) > 0 then
return config
end
end

Expand Down