From 8218db65e81addbc986407ae1df1bb1c804a563b Mon Sep 17 00:00:00 2001 From: Matt Paras Date: Tue, 8 Jul 2025 18:26:14 -0700 Subject: [PATCH] fix windows paths for registering additional search paths --- helix-term/src/commands/engine/steel.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/helix-term/src/commands/engine/steel.rs b/helix-term/src/commands/engine/steel.rs index 1d4ee6a02..91c27a3f5 100644 --- a/helix-term/src/commands/engine/steel.rs +++ b/helix-term/src/commands/engine/steel.rs @@ -3466,18 +3466,29 @@ fn configure_lsp_globals() { } writeln!(&mut output, "").unwrap(); + let search_path = helix_loader::config_dir(); + let search_path_str = search_path.to_str().unwrap(); + + #[cfg(target_os = "windows")] + let search_path_str: String = search_path_str.escape_default().collect(); + writeln!( &mut output, "(#%register-additional-search-path \"{}\")", - helix_loader::config_dir().to_str().unwrap() + search_path_str ) .unwrap(); for dir in helix_loader::runtime_dirs() { + let dir = dir.to_str().unwrap(); + + #[cfg(target_os = "windows")] + let dir: String = dir.escape_default().collect(); + writeln!( &mut output, "(#%register-additional-search-path \"{}\")", - dir.to_str().unwrap() + dir ) .unwrap(); }