From 66360675cf4d091b7460e4a8e1435c13216c1929 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sun, 11 Sep 2022 17:12:44 +0200 Subject: build: allow IWYU to fix includes for all .c files Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers. --- src/nvim/ui_client.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nvim/ui_client.h') diff --git a/src/nvim/ui_client.h b/src/nvim/ui_client.h index 311dafaa0b..bed73d83d3 100644 --- a/src/nvim/ui_client.h +++ b/src/nvim/ui_client.h @@ -1,8 +1,11 @@ #ifndef NVIM_UI_CLIENT_H #define NVIM_UI_CLIENT_H +#include + #include "nvim/api/private/defs.h" #include "nvim/grid_defs.h" +#include "nvim/macros.h" typedef struct { const char *name; -- cgit From 43e8ec92de9e0850e7d202cb7ff9051bc408447e Mon Sep 17 00:00:00 2001 From: bfredl Date: Mon, 2 May 2022 21:10:01 +0200 Subject: fix(tui): more work in the TUI --- src/nvim/ui_client.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/nvim/ui_client.h') diff --git a/src/nvim/ui_client.h b/src/nvim/ui_client.h index bed73d83d3..0b1f1ecb29 100644 --- a/src/nvim/ui_client.h +++ b/src/nvim/ui_client.h @@ -17,6 +17,26 @@ EXTERN size_t grid_line_buf_size INIT(= 0); EXTERN schar_T *grid_line_buf_char INIT(= NULL); EXTERN sattr_T *grid_line_buf_attr INIT(= NULL); +// ID of the ui client channel. If zero, the client is not running. +EXTERN uint64_t ui_client_channel_id INIT(= 0); + +// TODO(bfredl): the current structure for how tui and ui_client.c communicate is a bit awkward. +// This will be restructured as part of The UI Devirtualization Project. + +/// 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_respose 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); + +EXTERN char *ui_client_termname INIT(= "null"); + +#define UI_CLIENT_STDIN_FD 3 #ifdef INCLUDE_GENERATED_DECLARATIONS # include "ui_client.h.generated.h" -- cgit From c590641febf4d03e89c46f8e7ef4c3fb2a455520 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 1 Jan 2023 23:18:19 +0800 Subject: fix(tui): do not set ui_client_termname if it is already set (#21607) It is fine to initialize ui_client_termname to NULL as it is only used after tui_start(). --- src/nvim/ui_client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/ui_client.h') diff --git a/src/nvim/ui_client.h b/src/nvim/ui_client.h index 0b1f1ecb29..67d16e7fb1 100644 --- a/src/nvim/ui_client.h +++ b/src/nvim/ui_client.h @@ -34,7 +34,7 @@ EXTERN TriState ui_client_bg_respose INIT(= kNone); /// by convention, this uses fd=3 (next free number after stdio) EXTERN bool ui_client_forward_stdin INIT(= false); -EXTERN char *ui_client_termname INIT(= "null"); +EXTERN char *ui_client_termname INIT(= NULL); #define UI_CLIENT_STDIN_FD 3 #ifdef INCLUDE_GENERATED_DECLARATIONS -- cgit From 47ba78f89a1f0bba8168b4408bc55a3024d5ab97 Mon Sep 17 00:00:00 2001 From: bfredl Date: Fri, 30 Dec 2022 22:17:01 +0100 Subject: refactor(ui): devirtualize the ui layer - The defined interface for the UI is only the RPC protocol. The original UI interface as an array of function pointers fill no function. - On the server, all the UI:s are all RPC channels. - ui.c is only used on the server. - The compositor is a preprocessing step for single-grid UI:s - on the client, ui_client and tui talk directly to each other - we still do module separation, as ui_client.c could form the basis of a libnvim client module later. Items for later PR:s - vim.ui_attach is still an unhappy child, reconsider based on plugin experience. - the flags in ui_events.in.h are still a mess. Can be simplified now. - UX for remote attachment needs more work. - startup for client can be simplified further (think of the millisecs we can save) --- src/nvim/ui_client.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/nvim/ui_client.h') diff --git a/src/nvim/ui_client.h b/src/nvim/ui_client.h index 67d16e7fb1..24b8fad4cc 100644 --- a/src/nvim/ui_client.h +++ b/src/nvim/ui_client.h @@ -34,8 +34,6 @@ EXTERN TriState ui_client_bg_respose INIT(= kNone); /// by convention, this uses fd=3 (next free number after stdio) EXTERN bool ui_client_forward_stdin INIT(= false); -EXTERN char *ui_client_termname INIT(= NULL); - #define UI_CLIENT_STDIN_FD 3 #ifdef INCLUDE_GENERATED_DECLARATIONS # include "ui_client.h.generated.h" -- cgit