Resolve Zed's user configuration directory using its documented platform * locations. Linux honors XDG_CONFIG_HOME before ~/.config. */
| 2715 | /* Resolve Zed's user configuration directory using its documented platform |
| 2716 | * locations. Linux honors XDG_CONFIG_HOME before ~/.config. */ |
| 2717 | static void cbm_zed_config_dir(const char *home_dir, char *out, size_t out_sz) { |
| 2718 | if (out_sz == 0) { |
| 2719 | return; |
| 2720 | } |
| 2721 | out[0] = '\0'; |
| 2722 | if (!home_dir || !home_dir[0]) { |
| 2723 | return; |
| 2724 | } |
| 2725 | #ifdef __APPLE__ |
| 2726 | snprintf(out, out_sz, "%s/Library/Application Support/Zed", home_dir); |
| 2727 | #elif defined(_WIN32) |
| 2728 | snprintf(out, out_sz, "%s/AppData/Roaming/Zed", home_dir); |
| 2729 | #else |
| 2730 | char env_buf[CLI_BUF_1K]; |
| 2731 | const char *xdg = cbm_safe_getenv("XDG_CONFIG_HOME", env_buf, sizeof(env_buf), NULL); |
| 2732 | if (xdg && xdg[0]) { |
| 2733 | snprintf(out, out_sz, "%s/zed", xdg); |
| 2734 | } else { |
| 2735 | snprintf(out, out_sz, "%s/.config/zed", home_dir); |
| 2736 | } |
| 2737 | #endif |
| 2738 | } |
| 2739 | |
| 2740 | static void cbm_zed_instructions_path(const char *home_dir, char *out, size_t out_sz) { |
| 2741 | #ifdef _WIN32 |
no test coverage detected