Compare commits

...

3 Commits

Author SHA1 Message Date
luukvbaal d6173b1550
Merge b75dbe8df3 into c18d7941ef 2024-05-09 16:18:11 +00:00
Luuk van Baal b75dbe8df3 fix(tui): avoid invalidating regions with uninitialized grid
Problem:  Invalidated regions are flushed during startup while grid is
          still uninitialized. Resulting in blanking the grid to black,
          perceived as flickering.
Solution: Avoid flushing invalidated regions while the grid is
          uninitialized.
2024-05-09 18:12:44 +02:00
dundargoc c18d7941ef build: allow sccache as compiler cache
Also enable caching for dependencies.

Closes https://github.com/neovim/neovim/issues/28670
2024-05-09 16:39:45 +02:00
3 changed files with 16 additions and 6 deletions

View File

@ -50,11 +50,6 @@ file(GLOB DOCFILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
set_directory_properties(PROPERTIES
EP_PREFIX "${DEPS_BUILD_DIR}")
find_program(CCACHE_PRG ccache)
if(CCACHE_PRG)
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CCACHE_PRG})
endif()
if(NOT CI_BUILD)
set(CMAKE_INSTALL_MESSAGE NEVER)
endif()

View File

@ -23,6 +23,12 @@ if(POLICY CMP0092)
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_POLICY_DEFAULT_CMP0092=NEW)
endif()
find_program(CACHE_PRG NAMES ccache sccache)
if(CACHE_PRG)
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CACHE_PRG})
list(APPEND DEPS_CMAKE_CACHE_ARGS -DCMAKE_C_COMPILER_LAUNCHER:STRING=${CMAKE_C_COMPILER_LAUNCHER})
endif()
# MAKE_PRG
if(UNIX)
find_program(MAKE_PRG NAMES gmake make)
@ -58,7 +64,8 @@ function(get_externalproject_options name DEPS_IGNORE_SHA)
set(EXTERNALPROJECT_OPTIONS
DOWNLOAD_NO_PROGRESS TRUE
EXTERNALPROJECT_OPTIONS URL ${${name_allcaps}_URL})
EXTERNALPROJECT_OPTIONS URL ${${name_allcaps}_URL}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
if(NOT ${DEPS_IGNORE_SHA})
list(APPEND EXTERNALPROJECT_OPTIONS URL_HASH SHA256=${${name_allcaps}_SHA256})

View File

@ -108,6 +108,7 @@ struct TUIData {
bool set_cursor_color_as_str;
bool cursor_color_changed;
bool is_starting;
bool got_line;
FILE *screenshot;
cursorentry_T cursor_shapes[SHAPE_IDX_COUNT];
HlAttrs clear_attrs;
@ -1436,6 +1437,12 @@ void tui_flush(TUIData *tui)
}
while (kv_size(tui->invalid_regions)) {
// We don't want to invalidate regions when the entire grid is still invalid.
// Doing so will result in unnecessarily blanking the grid which results in flickering.
if (!tui->got_line) {
kv_size(tui->invalid_regions) = 0;
break;
}
Rect r = kv_pop(tui->invalid_regions);
assert(r.bot <= grid->height && r.right <= grid->width);
@ -1616,6 +1623,7 @@ void tui_raw_line(TUIData *tui, Integer g, Integer linerow, Integer startcol, In
Integer clearcol, Integer clearattr, LineFlags flags, const schar_T *chunk,
const sattr_T *attrs)
{
tui->got_line = true;
UGrid *grid = &tui->grid;
for (Integer c = startcol; c < endcol; c++) {
grid->cells[linerow][c].data = chunk[c - startcol];