@@ -45,16 +45,28 @@ impl Application {
45 let size = compositor.size();
45 let size = compositor.size();
46 let mut editor = Editor::new(size);
46 let mut editor = Editor::new(size);
48+ compositor.push(Box::new(ui::EditorView::new()));
48 if !args.files.is_empty() {
50 if !args.files.is_empty() {
51+ let first = &args.files[0]; // we know it's not empty
53+ editor.new_file(Action::VerticalSplit);
54+ compositor.push(Box::new(ui::file_picker(first.clone())));
49− for file in args.files {
56+ for file in args.files {
58+ return Err(anyhow::anyhow!(
59+ "expected a path to file, found a directory. (to open a directory pass it as first argument)"
50− editor.open(file, Action::VerticalSplit)?;
62+ editor.open(file, Action::VerticalSplit)?;
53 editor.new_file(Action::VerticalSplit);
67 editor.new_file(Action::VerticalSplit);
56− compositor.push(Box::new(ui::EditorView::new()));
58 let mut app = Self {
70 let mut app = Self {
59 compositor,
71 compositor,