diff options
| author | Maxime Coste <mawww@kakoune.org> | 2019-10-16 20:23:23 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2019-10-16 20:45:53 +1100 |
| commit | 3a36a2486e12be9150e28fa81ac707d65c425d45 (patch) | |
| tree | 9b6835f2427a9bae3bcff6556b16c6b6b58c66d2 /src | |
| parent | a1a63901c1601b56de6225564b2e392f9faf97fb (diff) | |
Slight cleanup of the menu display code
Diffstat (limited to 'src')
| -rw-r--r-- | src/ncurses_ui.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index 85785f9a..623e36bb 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -824,19 +824,18 @@ void NCursesUI::draw_menu() for (auto line = 0_line; line < win_height; ++line) { - m_menu.move_cursor(line); for (int col = 0; col < m_menu.columns; ++col) { + m_menu.move_cursor({line, col * column_width}); int item_idx = (first_col + col) * (int)m_menu.size.line + (int)line; auto& face = item_idx < item_count and item_idx == m_menu.selected_item ? m_menu.fg : m_menu.bg; - ColumnCount column = 0; if (item_idx < item_count) { const DisplayLine& item = m_menu.items[item_idx]; m_menu.draw(m_palette, item.atoms(), column_width, face); - column = item.length(); } - m_menu.draw(m_palette, DisplayAtom(String{' ', column_width - column}), column_width - column, face); + else + m_menu.draw(m_palette, DisplayAtom(String{}), column_width, face); } const bool is_mark = line >= mark_line and line < mark_line + mark_height; m_menu.move_cursor({line, m_menu.size.column - 1}); |
