Resolve Zed's user configuration directory using its documented platform * locations. Linux honors XDG_CONFIG_HOME before ~/.config. */
| 2243 | /* Resolve Zed's user configuration directory using its documented platform |
| 2244 | * locations. Linux honors XDG_CONFIG_HOME before ~/.config. */ |
| 2245 | static void cbm_zed_config_dir(const char *home_dir, char *out, size_t out_sz) { |
| 2246 | if (out_sz == 0) { |
| 2247 | return; |
| 2248 | } |
| 2249 | out[0] = '\0'; |
| 2250 | if (!home_dir || !home_dir[0]) { |
| 2251 | return; |
| 2252 | } |
| 2253 | #ifdef __APPLE__ |
| 2254 | snprintf(out, out_sz, "%s/Library/Application Support/Zed", home_dir); |
| 2255 | #elif defined(_WIN32) |
| 2256 | snprintf(out, out_sz, "%s/AppData/Roaming/Zed", home_dir); |
| 2257 | #else |
| 2258 | char env_buf[CLI_BUF_1K]; |
| 2259 | const char *xdg = cbm_safe_getenv("XDG_CONFIG_HOME", env_buf, sizeof(env_buf), NULL); |
| 2260 | if (xdg && xdg[0]) { |
| 2261 | snprintf(out, out_sz, "%s/zed", xdg); |
| 2262 | } else { |
| 2263 | snprintf(out, out_sz, "%s/.config/zed", home_dir); |
| 2264 | } |
| 2265 | #endif |
| 2266 | } |
| 2267 | |
| 2268 | static void cbm_zed_instructions_path(const char *home_dir, char *out, size_t out_sz) { |
| 2269 | #ifdef _WIN32 |
no test coverage detected