mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-04 22:03:48 +02:00
Ensure num_cols is never zero
This commit is contained in:
@@ -235,8 +235,8 @@ func (h *Handler) draw_list_of_results(matches *SortedResults, y, height int) (n
|
||||
}
|
||||
if num_matches > height {
|
||||
col_width = BASE_COL_WIDTH
|
||||
num_cols = available_width / col_width
|
||||
for num_cols > 0 && height*(num_cols-1) >= num_matches {
|
||||
num_cols = max(1, available_width/col_width)
|
||||
for num_cols > 1 && height*(num_cols-1) >= num_matches {
|
||||
num_cols--
|
||||
}
|
||||
col_width = available_width / num_cols
|
||||
|
||||
Reference in New Issue
Block a user