mirror of
https://github.com/neovide/neovide.git
synced 2026-09-10 07:16:25 -04:00
Allows using NEOVIDE_WSL or config file to set wsl (#1942)
* Allow using env var or config file for setting wsl * add wsl option in config doc
This commit is contained in:
parent
eeac6e76fc
commit
3dee458ee4
|
|
@ -45,7 +45,7 @@ pub struct CmdLineSettings {
|
|||
pub server: Option<String>,
|
||||
|
||||
/// Run NeoVim in WSL rather than on the host
|
||||
#[arg(long)]
|
||||
#[arg(long, env = "NEOVIDE_WSL")]
|
||||
pub wsl: bool,
|
||||
|
||||
/// Which window decorations to use (do note that the window might not be resizable
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ pub fn config_path() -> PathBuf {
|
|||
|
||||
#[derive(Debug, Deserialize, Default)]
|
||||
pub struct Config {
|
||||
pub wsl: Option<bool>,
|
||||
pub multigrid: Option<bool>,
|
||||
pub maximized: Option<bool>,
|
||||
pub vsync: Option<bool>,
|
||||
|
|
@ -52,6 +53,9 @@ impl Config {
|
|||
}
|
||||
|
||||
fn write_to_env(&self) {
|
||||
if let Some(wsl) = self.wsl {
|
||||
env::set_var("NEOVIDE_WSL", wsl.to_string());
|
||||
}
|
||||
if let Some(multigrid) = self.multigrid {
|
||||
env::set_var("NEOVIDE_MULTIGRID", multigrid.to_string());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ overridden by command line arguments.
|
|||
Settings currently available in the config file with default values:
|
||||
|
||||
```toml
|
||||
wsl = false
|
||||
multigrid = false
|
||||
vsync = true
|
||||
maximized = false
|
||||
|
|
|
|||
Loading…
Reference in a new issue