@@ -76,7 +76,7 @@ FLAGS:
76 helix_loader::default_log_file().display(),
76 helix_loader::default_log_file().display(),
79− let args = Args::parse_args().context("could not parse arguments")?;
79+ let mut args = Args::parse_args().context("could not parse arguments")?;
81 helix_loader::initialize_config_file(args.config_file.clone());
81 helix_loader::initialize_config_file(args.config_file.clone());
82 helix_loader::initialize_log_file(args.log_file.clone());
82 helix_loader::initialize_log_file(args.log_file.clone());
@@ -118,10 +118,14 @@ FLAGS:
119 // NOTE: Set the working directory early so the correct configuration is loaded. Be aware that
119 // NOTE: Set the working directory early so the correct configuration is loaded. Be aware that
120 // Application::new() depends on this logic so it must be updated if this changes.
120 // Application::new() depends on this logic so it must be updated if this changes.
121− if let Some((path, true)) = args.files.first().map(|(path, _)| (path, path.is_dir())) {
121+ if let Some(path) = &args.working_directory {
122 helix_loader::set_current_working_dir(path)?;
122 helix_loader::set_current_working_dir(path)?;
125+ // If the first file is a directory, it will be the working directory and a file picker will be opened
123− } else if let Some(path) = &args.working_directory {
126+ if let Some((path, _)) = args.files.first().filter(|p| p.0.is_dir()) {
124 helix_loader::set_current_working_dir(path)?;
127 helix_loader::set_current_working_dir(path)?;
128+ args.open_cwd = true; // Signal Application that we want to open the picker on "."
127 let config = match Config::load_default() {
131 let config = match Config::load_default() {