From 202d4766c2e0a27502f448ac1b46b46282b234ab Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 30 Apr 2015 13:45:05 +0100 Subject: [PATCH] Do not display info box when there is not enough room on screen for it Fixes #159 --- src/ncurses_ui.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index 49cab1b8..e275bbf0 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -832,6 +832,10 @@ void NCursesUI::info_show(StringView title, StringView content, else pos = compute_pos(anchor, size, m_menu_win, style == InfoStyle::InlineAbove); + // The info window will hide the status line + if (pos.line + size.line > m_dimensions.line) + return; + m_info_win = (NCursesWin*)newwin((int)size.line, (int)size.column, (int)pos.line, (int)pos.column);