TUI: rework background-color detection

- Like Vim, use set_option_value() followed by reset_option_was_set().
- Do not use set_string_default(), so the default is predictable.
  This affects `:set bg&`.
- Wait until end-of-startup (VimEnter) to handle the response. The
  response is racey anyways, so timing is irrelevant. This allows
  OptionSet to be triggered, unlike during startup.
This commit is contained in:
Justin M. Keyes
2019-02-17 11:32:18 +01:00
parent 6bd6927656
commit d3dc946155
4 changed files with 49 additions and 8 deletions

View File

@@ -83,10 +83,10 @@ EXTERN struct nvim_stats_s {
int64_t redraw;
} g_stats INIT(= { 0, 0 });
/* Values for "starting" */
#define NO_SCREEN 2 /* no screen updating yet */
#define NO_BUFFERS 1 /* not all buffers loaded yet */
/* 0 not starting anymore */
// Values for "starting".
#define NO_SCREEN 2 // no screen updating yet
#define NO_BUFFERS 1 // not all buffers loaded yet
// 0 not starting anymore
/*
* Number of Rows and Columns in the screen.