Skip to content

Commit

Permalink
Remove enable-swap option (fix #150)
Browse files Browse the repository at this point in the history
  • Loading branch information
daa84 committed Apr 21, 2019
1 parent 8d26c90 commit e9655f0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
6 changes: 1 addition & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,7 @@ fn main() {
.default_value("10")
.help("Wait timeout in seconds. If nvim does not response in given time NvimGtk stops")
.takes_value(true))
.arg(
Arg::with_name("enable-swap")
.long("enable-swap")
.help("Enable swap files"),
).arg(Arg::with_name("files").help("Files to open").multiple(true))
.arg(Arg::with_name("files").help("Files to open").multiple(true))
.arg(
Arg::with_name("nvim-bin-path")
.long("nvim-bin-path")
Expand Down
6 changes: 0 additions & 6 deletions src/nvim/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,13 @@ pub fn start(
nvim_bin_path: Option<&String>,
timeout: Option<Duration>,
args_for_neovim: Vec<String>,
enable_swap: bool,
) -> result::Result<Neovim, NvimInitError> {
let mut cmd = if let Some(path) = nvim_bin_path {
Command::new(path)
} else {
Command::new("nvim")
};

// Swap files are disabled by default because it shows message window on start up but frontend can't detect it.
if !enable_swap {
cmd.arg("-n");
}

cmd.arg("--embed")
.arg("--cmd")
.arg("set termguicolors")
Expand Down
3 changes: 0 additions & 3 deletions src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ pub struct ShellOptions {
timeout: Option<Duration>,
args_for_neovim: Vec<String>,
input_data: Option<String>,
enable_swap: bool,
}

impl ShellOptions {
Expand All @@ -611,7 +610,6 @@ impl ShellOptions {
.values_of("nvim-args")
.map(|args| args.map(str::to_owned).collect())
.unwrap_or(vec![]),
enable_swap: matches.is_present("enable-swap"),
}
}

Expand Down Expand Up @@ -1167,7 +1165,6 @@ fn init_nvim_async(
options.nvim_bin_path.as_ref(),
options.timeout,
options.args_for_neovim,
options.enable_swap,
) {
Ok(nvim) => nvim,
Err(err) => {
Expand Down

0 comments on commit e9655f0

Please sign in to comment.