From 298608f88c463705cfd6ee47035c049dbb1d9fa0 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Tue, 12 Jul 2016 22:52:10 -0700 Subject: Automatically detect terminal background and set bg=dark or bg=light xterm-compatible terminals support reporting their configured colors back to the application. Use this to obtain the current background color, compute its luminance to classify it as light or dark, and set 'bg' accordingly. Also set the default for 'bg', so that `:set bg&` will revert to that detected default. --- src/nvim/option.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/option.c') diff --git a/src/nvim/option.c b/src/nvim/option.c index 81f57522b3..5333c0291d 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -874,7 +874,7 @@ set_options_default ( /// @param name The name of the option /// @param val The value of the option /// @param allocated If true, do not copy default as it was already allocated. -static void set_string_default(const char *name, char *val, bool allocated) +void set_string_default(const char *name, char *val, bool allocated) FUNC_ATTR_NONNULL_ALL { int opt_idx = findoption((char_u *)name); -- cgit