Skip to content

Commit e90308d

Browse files
committed
Add terminal_info_inline_borders option
1 parent b06834b commit e90308d

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

doc/pages/options.asciidoc

+4
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ are exclusively available to built-in options.
381381
set the maximum allowable width of an info box. set to zero for
382382
no limit.
383383

384+
*terminal_info_inline_borders*:::
385+
if *yes* or *true*, borders will be drawn around info boxes with the
386+
*inline* style.
387+
384388
[[startup-info]]
385389
*startup_info_version* `int`::
386390
_default_ 0 +

src/main.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,8 @@ void register_options()
593593
" terminal_shift_function_key int\n"
594594
" terminal_padding_char codepoint\n"
595595
" terminal_padding_fill bool\n"
596-
" terminal_info_max_width int\n",
596+
" terminal_info_max_width int\n"
597+
" terminal_info_inline_borders bool\n",
597598
UserInterface::Options{});
598599
reg.declare_option("modelinefmt", "format string used to generate the modeline",
599600
"%val{bufname} %val{cursor_line}:%val{cursor_char_column} {{context_info}} {{mode_info}} - %val{client}@[%val{session}]"_str);

src/terminal_ui.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ void TerminalUI::Screen::output(bool force, bool synchronized, Writer& writer)
377377
{
378378
for (int line = 0; line < (int)size.line; ++line)
379379
{
380-
auto hash = hash_line(lines[line]);
380+
auto hash = hash_line(lines[line]);
381381
if (hash == hashes[line])
382382
continue;
383383
hashes[line] = hash;
@@ -1300,7 +1300,7 @@ void TerminalUI::info_show(const DisplayLine& title, const DisplayLineList& cont
13001300
m_info.face = face;
13011301
m_info.style = style;
13021302

1303-
const bool framed = style == InfoStyle::Prompt or style == InfoStyle::Modal;
1303+
const bool framed = style == InfoStyle::Prompt or style == InfoStyle::Modal or m_info_inline_borders;
13041304
const bool assisted = style == InfoStyle::Prompt and m_assistant.size() != 0;
13051305

13061306
DisplayCoord max_size = m_dimensions;
@@ -1555,6 +1555,7 @@ void TerminalUI::set_ui_options(const Options& options)
15551555
m_padding_fill = find("terminal_padding_fill").map(to_bool).value_or(false);
15561556

15571557
m_info_max_width = find("terminal_info_max_width").map(str_to_int_ifp).value_or(0);
1558+
m_info_inline_borders = find("terminal_info_inline_borders").map(to_bool).value_or(false);
15581559
}
15591560

15601561
}

src/terminal_ui.hh

+1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ private:
175175

176176
ColumnCount m_status_len = 0;
177177
ColumnCount m_info_max_width = 0;
178+
bool m_info_inline_borders = false;
178179
};
179180

180181
}

0 commit comments

Comments
 (0)