From 6b51c72e0cc99c6c03c521f77793028cf63afd45 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 11 Dec 2017 23:05:36 +0100 Subject: tui: rework deferred-termcodes implementation Try another approach to defer the termcodes. Seems less janky, but still not perfect. ref #7664 ref #7649 ref #7664 ref 27f9b1c7b029d8 --- src/nvim/ui.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/nvim/ui.h') diff --git a/src/nvim/ui.h b/src/nvim/ui.h index f1ea0716e6..84d17e9ec2 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -31,13 +31,12 @@ struct ui_t { bool ui_ext[UI_WIDGETS]; ///< Externalized widgets int width, height; void *data; - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "ui_events.generated.h" #endif - void (*event)(UI *ui, char *name, Array args, bool *args_consumed); void (*stop)(UI *ui); + void (*after_startup)(UI *ui); }; #ifdef INCLUDE_GENERATED_DECLARATIONS -- cgit From ed92ece815e1f32259b3f0397476ff6ac92726e3 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 12 Dec 2017 20:41:25 +0100 Subject: tui: defer termcodes using a timer With this implementation there is no "jank" during startup. Using the main_loop in any fashion is janky. Using only the TUI loop emits the termcodes too soon, or requires bad hacks like counting tui_flush invocations (9 seems to work). ref #7664 ref #7649 ref #7664 ref 27f9b1c7b029d8 --- src/nvim/ui.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/ui.h') diff --git a/src/nvim/ui.h b/src/nvim/ui.h index 84d17e9ec2..0e40a1a215 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -36,7 +36,6 @@ struct ui_t { #endif void (*event)(UI *ui, char *name, Array args, bool *args_consumed); void (*stop)(UI *ui); - void (*after_startup)(UI *ui); }; #ifdef INCLUDE_GENERATED_DECLARATIONS -- cgit From 5d8da126d0b5ab7f550a74264ba434a2ad04280e Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Tue, 6 Feb 2018 19:46:45 +0100 Subject: ui/tui: highlighting refactor Make HlAttr contain highlighting state for both color modes (cterm and rgb). This allows us to implement termguicolors completely in the TUI. Simplify some logic duplicated between ui.c and screen.c. Also avoid some superfluous highlighting reset events. --- src/nvim/ui.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/nvim/ui.h') diff --git a/src/nvim/ui.h b/src/nvim/ui.h index 0e40a1a215..60adcb974f 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -16,14 +16,6 @@ typedef enum { } UIWidget; #define UI_WIDGETS (kUIWildmenu + 1) -typedef struct { - bool bold, underline, undercurl, italic, reverse; - int foreground, background, special; -} HlAttrs; - -#define HLATTRS_INIT \ - ((HlAttrs){ false, false, false, false, false, -1, -1, -1 }) - typedef struct ui_t UI; struct ui_t { -- cgit From 6e5cb0debd23693175bd05409d3f1af4015567df Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Tue, 13 Feb 2018 13:45:49 +0100 Subject: ui: refactor ui options --- src/nvim/ui.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/nvim/ui.h') diff --git a/src/nvim/ui.h b/src/nvim/ui.h index 60adcb974f..48896a6a3f 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -13,14 +13,22 @@ typedef enum { kUIPopupmenu, kUITabline, kUIWildmenu, -} UIWidget; -#define UI_WIDGETS (kUIWildmenu + 1) + kUIExtCount, +} UIExtension; + +EXTERN const char *ui_ext_names[] INIT(= { + "ext_cmdline", + "ext_popupmenu", + "ext_tabline", + "ext_wildmenu" +}); + typedef struct ui_t UI; struct ui_t { bool rgb; - bool ui_ext[UI_WIDGETS]; ///< Externalized widgets + bool ui_ext[kUIExtCount]; ///< Externalized widgets int width, height; void *data; #ifdef INCLUDE_GENERATED_DECLARATIONS -- cgit