diff options
| author | bfredl <bjorn.linse@gmail.com> | 2024-05-10 20:01:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-10 20:01:17 +0200 |
| commit | a2c158ad063bef6d43687dcf78956cd4e56717e4 (patch) | |
| tree | bb0f28b6137fa434825a0a697d7031354376e046 /src/nvim | |
| parent | 17d8f3b32ac18fcabf8e9869b8d9b88df27d1934 (diff) | |
| parent | fd50185492c7c5b042cc81fe1fde882bcff03c1b (diff) | |
| download | rneovim-a2c158ad063bef6d43687dcf78956cd4e56717e4.tar.gz rneovim-a2c158ad063bef6d43687dcf78956cd4e56717e4.tar.bz2 rneovim-a2c158ad063bef6d43687dcf78956cd4e56717e4.zip | |
Merge pull request #28676 from luukvbaal/tuiflush
fix(tui): initialize clear attrs with current terminal background
Diffstat (limited to 'src/nvim')
| -rw-r--r-- | src/nvim/tui/tui.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index e1bb1e55e3..10f5ed32b0 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -23,6 +23,7 @@ #include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/grid_defs.h" +#include "nvim/highlight.h" #include "nvim/highlight_defs.h" #include "nvim/log.h" #include "nvim/macros_defs.h" @@ -165,6 +166,15 @@ void tui_start(TUIData **tui_p, int *width, int *height, char **term, bool *rgb) tui->seen_error_exit = 0; tui->loop = &main_loop; tui->url = -1; + // Because setting the default colors is delayed until after startup to avoid + // flickering with the default colorscheme background, any flush that happens + // during startup in turn would result in clearing invalidated regions with + // uninitialized attrs(black). Instead initialize clear_attrs with current + // terminal background so that it is at least not perceived as flickering, even + // though it may be different from the colorscheme that is set during startup. + tui->clear_attrs.rgb_bg_color = normal_bg; + tui->clear_attrs.cterm_bg_color = (int16_t)cterm_normal_bg_color; + kv_init(tui->invalid_regions); kv_init(tui->urlbuf); signal_watcher_init(tui->loop, &tui->winch_handle, tui); |