File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -174,22 +174,21 @@ impl<'a> Render<'a> {
174
174
} ;
175
175
176
176
if the_grid_fits {
177
- if column_count == file_names. len ( ) {
178
- return Some ( ( grid, column_count) ) ;
179
- } else {
180
- last_working_grid = grid;
181
- }
182
- } else {
183
- // If we’ve figured out how many columns can fit in the user’s
184
- // terminal, and it turns out there aren’t enough rows to
185
- // make it worthwhile, then just resort to the lines view.
177
+ last_working_grid = grid;
178
+ }
179
+
180
+ if !the_grid_fits || column_count == file_names. len ( ) {
181
+ let last_column_count = if the_grid_fits { column_count } else { column_count - 1 } ;
182
+ // If we’ve figured out how many columns can fit in the user’s terminal,
183
+ // and it turns out there aren’t enough rows to make it worthwhile
184
+ // (according to EXA_GRID_ROWS), then just resort to the lines view.
186
185
if let RowThreshold :: MinimumRows ( thresh) = self . row_threshold {
187
- if last_working_grid. fit_into_columns ( column_count - 1 ) . row_count ( ) < thresh {
186
+ if last_working_grid. fit_into_columns ( last_column_count ) . row_count ( ) < thresh {
188
187
return None ;
189
188
}
190
189
}
191
190
192
- return Some ( ( last_working_grid, column_count - 1 ) ) ;
191
+ return Some ( ( last_working_grid, last_column_count ) ) ;
193
192
}
194
193
}
195
194
You can’t perform that action at this time.
0 commit comments