From 66b550f231118b2e10dabc58de769d917fc0cc3b Mon Sep 17 00:00:00 2001 From: Caleb Heuer Date: Thu, 16 Nov 2023 17:10:37 -0700 Subject: [PATCH] Add terminal_info_inline_borders option --- doc/pages/options.asciidoc | 4 ++++ src/main.cc | 3 ++- src/terminal_ui.cc | 3 ++- src/terminal_ui.hh | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/pages/options.asciidoc b/doc/pages/options.asciidoc index e5cb4c3821..4d5c156db1 100644 --- a/doc/pages/options.asciidoc +++ b/doc/pages/options.asciidoc @@ -385,6 +385,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 5eb30bc6b6..307dca6c0e 100644 --- a/src/main.cc +++ b/src/main.cc @@ -603,7 +603,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 672626e48b..f2fb4f90ce 100644 --- a/src/terminal_ui.cc +++ b/src/terminal_ui.cc @@ -1320,7 +1320,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; @@ -1576,6 +1576,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 02085532f8..9ec819ec66 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; }; }