aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorhlpr98 <hlpr98@gmail.com>2022-04-16 14:46:20 +0200
committerbfredl <bjorn.linse@gmail.com>2022-04-17 11:41:56 +0200
commitd63ad42e4978c2de9486e383fc9865f22a743939 (patch)
tree9bc5e18d4cf990ebf41d3bfccf03ff06171b9fa3 /src/nvim/option.c
parenta8d5a9e81929a983f94555fd5ac2ea2579402eef (diff)
downloadrneovim-d63ad42e4978c2de9486e383fc9865f22a743939.tar.gz
rneovim-d63ad42e4978c2de9486e383fc9865f22a743939.tar.bz2
rneovim-d63ad42e4978c2de9486e383fc9865f22a743939.zip
feat(api): ui options relevant for remote TUI
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 83d56c01fe..c073c6d71b 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -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.