feat(api): ui options relevant for remote TUI

This commit is contained in:
hlpr98
2022-04-16 14:46:20 +02:00
committed by bfredl
parent a8d5a9e819
commit d63ad42e49
4 changed files with 49 additions and 12 deletions

View File

@@ -4914,6 +4914,23 @@ bool set_tty_option(const char *name, char *value)
return false;
}
void set_tty_background(const char *value)
{
if (option_was_set("bg") || strequal((char *)p_bg, value)) {
// background is already set... ignore
return;
}
if (starting) {
// Wait until after startup, so OptionSet is triggered.
do_cmdline_cmd((value[0] == 'l')
? "autocmd VimEnter * ++once ++nested set bg=light"
: "autocmd VimEnter * ++once ++nested set bg=dark");
} else {
set_option_value("bg", 0L, value, 0);
reset_option_was_set("bg");
}
}
/// Find index for an option
///
/// @param[in] arg Option name.