From 9fcbbfa46762484fc132383d9c2855ce37f60d6f Mon Sep 17 00:00:00 2001 From: Cor Date: Wed, 14 Jul 2021 21:29:39 +0200 Subject: Changed startup behaviour to only open a single view when multiple files are specified on the commandline. Changed the behaviour; the first argument on the commandline is the file on display --- helix-term/src/application.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'helix-term/src/application.rs') diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 79dd7c3b..c55d4c98 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -83,15 +83,18 @@ impl Application { editor.new_file(Action::VerticalSplit); compositor.push(Box::new(ui::file_picker(first.clone()))); } else { + let nr_of_files = args.files.len(); + editor.open(first.to_path_buf(), Action::VerticalSplit)?; for file in args.files { if file.is_dir() { return Err(anyhow::anyhow!( "expected a path to file, found a directory. (to open a directory pass it as first argument)" )); } else { - editor.open(file, Action::VerticalSplit)?; + editor.open(file.to_path_buf(), Action::Load)?; } } + editor.set_status(format!("Loaded {} files.", nr_of_files)); } } else { editor.new_file(Action::VerticalSplit); -- cgit v1.2.3-70-g09d2