File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,10 +151,7 @@ impl Application {
151151 compositor. push ( Box :: new ( overlayed ( picker) ) ) ;
152152 } else {
153153 let nr_of_files = args. files . len ( ) ;
154- editor. open ( first, Action :: VerticalSplit ) ?;
155- // Because the line above already opens the first file, we can
156- // simply skip opening it a second time by using .skip(1) here.
157- for ( file, pos) in args. files . into_iter ( ) . skip ( 1 ) {
154+ for ( i, ( file, pos) ) in args. files . into_iter ( ) . enumerate ( ) {
158155 if file. is_dir ( ) {
159156 return Err ( anyhow:: anyhow!(
160157 "expected a path to file, found a directory. (to open a directory pass it as first argument)"
@@ -166,6 +163,7 @@ impl Application {
166163 // option. If neither of those two arguments are passed
167164 // in, just load the files normally.
168165 let action = match args. split {
166+ _ if i == 0 => Action :: VerticalSplit ,
169167 Some ( Layout :: Vertical ) => Action :: VerticalSplit ,
170168 Some ( Layout :: Horizontal ) => Action :: HorizontalSplit ,
171169 None => Action :: Load ,
You can’t perform that action at this time.
0 commit comments