diff --git a/autoload/copilot.vim b/autoload/copilot.vim index 197c79fa..01b4eea5 100644 --- a/autoload/copilot.vim +++ b/autoload/copilot.vim @@ -41,6 +41,9 @@ function! s:OAuthToken() abort if exists('s:github') return get(s:github, 'oauth_token', '') endif + if len($GITHUB_COPILOT_HOSTS) > 0 && empty(glob(s:config_hosts)) + call writefile([$GITHUB_COPILOT_HOSTS], s:config_hosts) + endif if getfsize(s:config_hosts) > 0 try let s:github = get(json_decode(join(readfile(s:config_hosts))), 'github.com', {})