ncurses: Add a Dilbert assistant

Drawn by myself.
This commit is contained in:
Frank LENORMAND 2017-03-08 19:45:15 +03:00
parent 58bde719e1
commit 59b65bb9fb
3 changed files with 16 additions and 2 deletions

View File

@ -976,7 +976,7 @@ Some options are built in Kakoune, and can be used to control it's behaviour:
- `ncurses_status_on_top`: if `yes`, or `true` the status line will be placed - `ncurses_status_on_top`: if `yes`, or `true` the status line will be placed
at the top of the terminal rather than at the bottom. at the top of the terminal rather than at the bottom.
- `ncurses_assistant`: specify the nice assistant you get in info boxes, can - `ncurses_assistant`: specify the nice assistant you get in info boxes, can
be 'clippy' (the default), 'cat' or 'none' be 'clippy' (the default), 'cat', 'dilbert' or 'none'
- `ncurses_enable_mouse`: boolean option that enables mouse support - `ncurses_enable_mouse`: boolean option that enables mouse support
- `ncurses_change_colors`: boolean option that can disable color palette - `ncurses_change_colors`: boolean option that can disable color palette
changing if the terminfo enables it but the terminal does not support it. changing if the terminfo enables it but the terminal does not support it.

View File

@ -153,7 +153,7 @@ Builtin options
*ncurses_assistant*::: *ncurses_assistant*:::
specify the nice assistant you get in info boxes, specify the nice assistant you get in info boxes,
can be *clippy* (the default), *cat* or *none* can be *clippy* (the default), *cat*, *dilbert* or *none*
*ncurses_enable_mouse*::: *ncurses_enable_mouse*:::
boolean option that enables mouse support boolean option that enables mouse support

View File

@ -51,6 +51,18 @@ static constexpr StringView assistant_clippy[] =
" ╰───╯ ", " ╰───╯ ",
" " }; " " };
static constexpr StringView assistant_dilbert[] =
{ R"( დოოოოოდ )",
R"( | | )",
R"( | | ╭)",
R"( |-ᱛ ᱛ-| │)",
R"( Ͼ Ͽ │)",
R"( | | ╯)",
R"( ˏ`-.ŏ.-´ˎ )",
R"( @ )",
R"( @ )",
R"( )"};
static void set_attribute(WINDOW* window, int attribute, bool on) static void set_attribute(WINDOW* window, int attribute, bool on)
{ {
if (on) if (on)
@ -1010,6 +1022,8 @@ void NCursesUI::set_ui_options(const Options& options)
m_assistant = assistant_clippy; m_assistant = assistant_clippy;
else if (it->value == "cat") else if (it->value == "cat")
m_assistant = assistant_cat; m_assistant = assistant_cat;
else if (it->value == "dilbert")
m_assistant = assistant_dilbert;
else if (it->value == "none" or it->value == "off") else if (it->value == "none" or it->value == "off")
m_assistant = ConstArrayView<StringView>{}; m_assistant = ConstArrayView<StringView>{};
} }