diff options
| author | Maxime Coste <mawww@kakoune.org> | 2022-09-17 12:02:33 +0200 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2022-09-17 12:02:33 +0200 |
| commit | be5547ffd0a7698be7a206b59a5a5ea84352bacc (patch) | |
| tree | f11db1423f79917ded4a69ac774944ab3a85949a | |
| parent | 8f7b1df9ab658cbd6385ddd55e538f4b1f0a600a (diff) | |
| parent | f50ee5bb5aa153c49e32791079c3c7fbaacab222 (diff) | |
Merge remote-tracking branch 'arrufat/fix-crash-menu-small-window'
| -rw-r--r-- | src/terminal_ui.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/terminal_ui.cc b/src/terminal_ui.cc index a20d27ee..b788dbe8 100644 --- a/src/terminal_ui.cc +++ b/src/terminal_ui.cc @@ -1073,6 +1073,9 @@ void TerminalUI::menu_show(ConstArrayView<DisplayLine> items, const LineCount height = is_search ? 1 : (min<LineCount>(max_height, div_round_up(item_count, m_menu.columns))); + if (height == 0) + return; + const ColumnCount maxlen = (m_menu.columns > 1 and item_count > 1) ? max_width / m_menu.columns - 1 : max_width; |
