Add WSL arg and code to use the Windows WSL

macos-click-through
Nicholas Jarretta 5 years ago
parent e9808f185f
commit 703b7bbe5b

@ -32,8 +32,27 @@ fn set_windows_creation_flags(cmd: &mut Command) {
cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
} }
#[cfg(target_os = "windows")]
fn build_cmd() -> Command {
if std::env::args()
.collect::<Vec<String>>()
.contains(&String::from("--wsl"))
{
let mut cmd = Command::new("wsl");
cmd.arg("nvim");
cmd
} else {
Command::new("nvim")
}
}
#[cfg(not(target_os = "windows"))]
fn build_cmd() -> Command {
Command::new("nvim")
}
fn create_nvim_command() -> Command { fn create_nvim_command() -> Command {
let mut cmd = Command::new("nvim"); let mut cmd = build_cmd();
cmd.arg("--embed") cmd.arg("--embed")
.args(SETTINGS.neovim_arguments.iter().skip(1)) .args(SETTINGS.neovim_arguments.iter().skip(1))

@ -140,6 +140,8 @@ impl Settings {
false false
} else if arg.starts_with("--geometry=") { } else if arg.starts_with("--geometry=") {
false false
} else if arg == "--wsl" {
false
} else { } else {
true true
} }

Loading…
Cancel
Save