From c0b0182163b293f002451a2e422d740b2994af3c Mon Sep 17 00:00:00 2001 From: Heyward Fann Date: Wed, 1 Feb 2023 11:35:13 +0800 Subject: [PATCH] fix(util): check $XDG_CONFIG_HOME before use as data home --- autoload/coc/util.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/coc/util.vim b/autoload/coc/util.vim index 74ba42b0350..3c1ed2fc930 100644 --- a/autoload/coc/util.vim +++ b/autoload/coc/util.vim @@ -536,7 +536,7 @@ function! coc#util#get_data_home() if !empty(get(g:, 'coc_data_home', '')) let dir = resolve(expand(g:coc_data_home)) else - if exists('$XDG_CONFIG_HOME') + if exists('$XDG_CONFIG_HOME') && isdirectory(resolve($XDG_CONFIG_HOME)) let dir = resolve($XDG_CONFIG_HOME."/coc") else if s:is_win