diff --git a/doc/pages/options.asciidoc b/doc/pages/options.asciidoc index 4f69cbfb7e..5cdf3b2ce1 100644 --- a/doc/pages/options.asciidoc +++ b/doc/pages/options.asciidoc @@ -381,6 +381,10 @@ are exclusively available to built-in options. set the maximum allowable width of an info box. set to zero for no limit. + *terminal_info_inline_borders*::: + if *yes* or *true*, borders will be drawn around info boxes with the + *inline* style. + [[startup-info]] *startup_info_version* `int`:: _default_ 0 + diff --git a/src/main.cc b/src/main.cc index 98181601fd..a8eb95cf06 100644 --- a/src/main.cc +++ b/src/main.cc @@ -593,7 +593,8 @@ void register_options() " terminal_shift_function_key int\n" " terminal_padding_char codepoint\n" " terminal_padding_fill bool\n" - " terminal_info_max_width int\n", + " terminal_info_max_width int\n" + " terminal_info_inline_borders bool\n", UserInterface::Options{}); reg.declare_option("modelinefmt", "format string used to generate the modeline", "%val{bufname} %val{cursor_line}:%val{cursor_char_column} {{context_info}} {{mode_info}} - %val{client}@[%val{session}]"_str); diff --git a/src/terminal_ui.cc b/src/terminal_ui.cc index db9679765f..7cb2ba80a2 100644 --- a/src/terminal_ui.cc +++ b/src/terminal_ui.cc @@ -377,7 +377,7 @@ void TerminalUI::Screen::output(bool force, bool synchronized, Writer& writer) { for (int line = 0; line < (int)size.line; ++line) { - auto hash = hash_line(lines[line]); + auto hash = hash_line(lines[line]); if (hash == hashes[line]) continue; hashes[line] = hash; @@ -1300,7 +1300,7 @@ void TerminalUI::info_show(const DisplayLine& title, const DisplayLineList& cont m_info.face = face; m_info.style = style; - const bool framed = style == InfoStyle::Prompt or style == InfoStyle::Modal; + const bool framed = style == InfoStyle::Prompt or style == InfoStyle::Modal or m_info_inline_borders; const bool assisted = style == InfoStyle::Prompt and m_assistant.size() != 0; DisplayCoord max_size = m_dimensions; @@ -1555,6 +1555,7 @@ void TerminalUI::set_ui_options(const Options& options) m_padding_fill = find("terminal_padding_fill").map(to_bool).value_or(false); m_info_max_width = find("terminal_info_max_width").map(str_to_int_ifp).value_or(0); + m_info_inline_borders = find("terminal_info_inline_borders").map(to_bool).value_or(false); } } diff --git a/src/terminal_ui.hh b/src/terminal_ui.hh index 85583a1d34..a6dcf124c4 100644 --- a/src/terminal_ui.hh +++ b/src/terminal_ui.hh @@ -175,6 +175,7 @@ private: ColumnCount m_status_len = 0; ColumnCount m_info_max_width = 0; + bool m_info_inline_borders = false; }; }