From b7c425bd36f89f5efec6db717151a5d54cb88231 Mon Sep 17 00:00:00 2001 From: Joan Milev Date: Mon, 7 Jun 2021 23:42:33 +0300 Subject: [PATCH] add xdg support --- src/config.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config.hh b/src/config.hh index 751a712c..0e04b283 100644 --- a/src/config.hh +++ b/src/config.hh @@ -35,7 +35,8 @@ struct Config { // // If empty, retainInMemory will be set to 1 and cache will be stored in // memory. - std::string directory = ".ccls-cache"; + std::string cache_dir = getenv("XDG_CACHE_HOME"); + std::string directory = cache_dir + "/ccls-cache"; // Cache serialization format. //