From 24d719bf13473f6c3ebd0a5ef8d2296954ca38ab Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Tue, 12 Mar 2024 20:34:06 +0100 Subject: [PATCH] Fix off-by-two error in max size of frameless infoboxes Framed info boxes need one cell for the border and one for inner space padding. That's 4 extra columns when counting both sides. Frameless boxes have neither border nor padding so 0 columns here. Closes #5106 --- src/terminal_ui.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/terminal_ui.cc b/src/terminal_ui.cc index db967976..3ad95e40 100644 --- a/src/terminal_ui.cc +++ b/src/terminal_ui.cc @@ -1311,7 +1311,7 @@ void TerminalUI::info_show(const DisplayLine& title, const DisplayLineList& cont max_size.line -= m_menu.size.line; const auto max_content_width = (m_info_max_width > 0 ? std::min(max_size.column, m_info_max_width) : max_size.column) - - (framed ? 4 : 2) - + (framed ? 4 : 0) - (assisted ? m_assistant[0].column_length() : 0); if (max_content_width <= 0) return;