diff options
author | Gregory Anders <greg@gpanders.com> | 2023-11-07 11:31:21 -0600 |
---|---|---|
committer | Gregory Anders <greg@gpanders.com> | 2023-11-13 19:04:47 -0600 |
commit | 8d9789a0f3b748b75ac4ae1b8e43d27af40d49fe (patch) | |
tree | 5872a66135c1250a32da15b981bb36118e58d347 /src | |
parent | ab102f188e86bdbfce1d4de2ef633092a906e8fe (diff) | |
download | rneovim-8d9789a0f3b748b75ac4ae1b8e43d27af40d49fe.tar.gz rneovim-8d9789a0f3b748b75ac4ae1b8e43d27af40d49fe.tar.bz2 rneovim-8d9789a0f3b748b75ac4ae1b8e43d27af40d49fe.zip |
docs: deprecate the "term_background" UI field
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/api/ui.c | 1 | ||||
-rw-r--r-- | src/nvim/ui.c | 5 | ||||
-rw-r--r-- | src/nvim/ui.h | 3 | ||||
-rw-r--r-- | src/nvim/ui_client.c | 5 | ||||
-rw-r--r-- | src/nvim/ui_client.h | 4 |
5 files changed, 7 insertions, 11 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index a215317a83..e6d9035b0d 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -120,7 +120,6 @@ void remote_ui_disconnect(uint64_t channel_id) // Destroy `ui`. XFREE_CLEAR(ui->term_name); - XFREE_CLEAR(ui->term_background); xfree(ui); } diff --git a/src/nvim/ui.c b/src/nvim/ui.c index dc38c061b0..3e5bfba315 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -623,7 +623,10 @@ Array ui_array(void) // TUI fields. (`stdin_fd` is intentionally omitted.) PUT(info, "term_name", CSTR_TO_OBJ(ui->term_name)); - PUT(info, "term_background", CSTR_TO_OBJ(ui->term_background)); + + // term_background is deprecated. Populate with an empty string + PUT(info, "term_background", CSTR_TO_OBJ("")); + PUT(info, "term_colors", INTEGER_OBJ(ui->term_colors)); PUT(info, "stdin_tty", BOOLEAN_OBJ(ui->stdin_tty)); PUT(info, "stdout_tty", BOOLEAN_OBJ(ui->stdout_tty)); diff --git a/src/nvim/ui.h b/src/nvim/ui.h index d399802c99..3feb0bf603 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -104,7 +104,8 @@ struct ui_t { // TUI fields. char *term_name; - char *term_background; + char *term_background; ///< Deprecated. No longer needed since background color detection happens + ///< in Lua. To be removed in a future release. int term_colors; bool stdin_tty; bool stdout_tty; diff --git a/src/nvim/ui_client.c b/src/nvim/ui_client.c index dac690822b..2f91257a5d 100644 --- a/src/nvim/ui_client.c +++ b/src/nvim/ui_client.c @@ -84,10 +84,7 @@ void ui_client_attach(int width, int height, char *term) if (term) { PUT_C(opts, "term_name", CSTR_AS_OBJ(term)); } - if (ui_client_bg_response != kNone) { - bool is_dark = (ui_client_bg_response == kTrue); - PUT_C(opts, "term_background", CSTR_AS_OBJ(is_dark ? "dark" : "light")); - } + PUT_C(opts, "term_colors", INTEGER_OBJ(t_colors)); if (!ui_client_is_remote) { PUT_C(opts, "stdin_tty", BOOLEAN_OBJ(stdin_isatty)); diff --git a/src/nvim/ui_client.h b/src/nvim/ui_client.h index fbee942cdf..db1ab463f8 100644 --- a/src/nvim/ui_client.h +++ b/src/nvim/ui_client.h @@ -31,10 +31,6 @@ EXTERN int ui_client_exit_status INIT( = 0); /// Whether ui client has sent nvim_ui_attach yet EXTERN bool ui_client_attached INIT( = false); -/// Whether ui client has gotten a response about the bg color of the terminal, -/// kTrue=dark, kFalse=light, kNone=no response yet -EXTERN TriState ui_client_bg_response INIT( = kNone); - /// The ui client should forward its stdin to the nvim process /// by convention, this uses fd=3 (next free number after stdio) EXTERN bool ui_client_forward_stdin INIT( = false); |