Do not draw menu if it would hide prompt content

This commit is contained in:
Maxime Coste 2018-06-20 08:12:53 +10:00
parent 226db75aeb
commit b82d31016b
2 changed files with 7 additions and 2 deletions

View File

@ -324,7 +324,9 @@ void NCursesUI::redraw()
pnoutrefresh(m_window, 0, 0, 0, 0,
(int)m_dimensions.line + 1, (int)m_dimensions.column);
if (m_menu.columns != 0 or m_menu.pos.column > m_status_len)
m_menu.refresh();
m_info.refresh();
if (m_cursor.mode == CursorMode::Prompt)
@ -432,7 +434,8 @@ void NCursesUI::draw_status(const DisplayLine& status_line,
draw_line(m_window, status_line, 0, m_dimensions.column, default_face);
const auto mode_len = mode_line.length();
const auto remaining = m_dimensions.column - status_line.length();
m_status_len = status_line.length();
const auto remaining = m_dimensions.column - m_status_len;
if (mode_len < remaining)
{
ColumnCount col = m_dimensions.column - mode_len;

View File

@ -151,6 +151,8 @@ private:
bool m_resize_pending = false;
void set_resize_pending();
ColumnCount m_status_len = 0;
};
}