diff --git a/doc/pages/options.asciidoc b/doc/pages/options.asciidoc index a63fe39a..c12c9721 100644 --- a/doc/pages/options.asciidoc +++ b/doc/pages/options.asciidoc @@ -353,6 +353,15 @@ are exclusively available to built-in options. Function key from which shifted function key start, if the terminal sends F13 for , this should be set to 12. + *ncurses_padding_char*::: + character used to indicate the area out of the displayed buffer + (defaults to '~') + + *ncurses_padding_fill*::: + if *yes* or *true*, fill the padding area with the padding character + instead of displaying a single character at the beginning of the + padding line (defaults to *false*) + [[startup-info]] *startup_info_version* `int`:: _default_ 0 + diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index 17006c13..d2d93b0e 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -474,7 +474,14 @@ void NCursesUI::draw(const DisplayBuffer& display_buffer, while (line_index < dim.line + line_offset) { m_window.move_cursor(line_index++); - m_window.draw(m_palette, DisplayAtom("~"), face); + if (m_padding_fill) + { + ColumnCount column_index = 0; + while (column_index++ < dim.column) + m_window.draw(m_palette, m_padding_char, face); + } + else + m_window.draw(m_palette, m_padding_char, face); } m_dirty = true; @@ -1361,6 +1368,22 @@ void NCursesUI::set_ui_options(const Options& options) m_wheel_scroll_amount = wheel_scroll_amount_it != options.end() ? str_to_int_ifp(wheel_scroll_amount_it->value).value_or(3) : 3; } + + { + auto it = options.find("ncurses_padding_char"_sv); + if (it == options.end()) + m_padding_char = DisplayAtom("~"); + else if (it->value.length() < 1) + m_padding_char = DisplayAtom(" "); + else + m_padding_char = DisplayAtom(it->value); + } + + { + auto it = options.find("ncurses_padding_fill"_sv); + m_padding_fill = it != options.end() and + (it->value == "yes" or it->value == "true"); + } } } diff --git a/src/ncurses_ui.hh b/src/ncurses_ui.hh index 693e6608..4cc354cd 100644 --- a/src/ncurses_ui.hh +++ b/src/ncurses_ui.hh @@ -169,6 +169,9 @@ private: bool m_set_title = true; + DisplayAtom m_padding_char = DisplayAtom("~"); + bool m_padding_fill = false; + bool m_dirty = false; bool m_resize_pending = false;