Skip to content

Commit

Permalink
Add terminal_info_inline_borders option
Browse files Browse the repository at this point in the history
  • Loading branch information
raiguard committed Mar 13, 2024
1 parent 83f12fc commit 1e66089
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions doc/pages/options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
Expand Down
3 changes: 2 additions & 1 deletion src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions src/terminal_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

}
1 change: 1 addition & 0 deletions src/terminal_ui.hh
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ private:

ColumnCount m_status_len = 0;
ColumnCount m_info_max_width = 0;
bool m_info_inline_borders = false;
};

}
Expand Down

0 comments on commit 1e66089

Please sign in to comment.