mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-25 04:24:48 +03:00
fix NCursesClient::menu_select for one past last item
This commit is contained in:
parent
ee4c6b04a6
commit
859e907396
@ -254,7 +254,8 @@ void NCursesClient::menu_show(const memoryview<String>& choices)
|
||||
|
||||
void NCursesClient::menu_select(int selected)
|
||||
{
|
||||
if (0 <= selected and selected < m_items.size())
|
||||
// last item in m_items is the nullptr, hence the - 1
|
||||
if (selected >= 0 and selected < m_items.size() - 1)
|
||||
{
|
||||
set_menu_fore(m_menu, COLOR_PAIR(m_menu_fg));
|
||||
set_current_item(m_menu, m_items[selected]);
|
||||
|
Loading…
Reference in New Issue
Block a user