mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 03:16:31 +00:00
refactor(ui): cleanup 'redrawdebug', introduce "flush" mode
This commit is contained in:
@@ -630,6 +630,8 @@ EXTERN unsigned rdb_flags;
|
||||
#define RDB_NOTHROTTLE 0x002
|
||||
#define RDB_INVALID 0x004
|
||||
#define RDB_NODELTA 0x008
|
||||
#define RDB_LINE 0x010
|
||||
#define RDB_FLUSH 0x020
|
||||
|
||||
EXTERN long p_rdt; // 'redrawtime'
|
||||
EXTERN long p_re; // 'regexpengine'
|
||||
|
@@ -125,7 +125,8 @@ static char *(p_spo_values[]) = { "camel", "noplainbuffer", NULL };
|
||||
static char *(p_icm_values[]) = { "nosplit", "split", NULL };
|
||||
static char *(p_jop_values[]) = { "stack", "view", NULL };
|
||||
static char *(p_tpf_values[]) = { "BS", "HT", "FF", "ESC", "DEL", "C0", "C1", NULL };
|
||||
static char *(p_rdb_values[]) = { "compositor", "nothrottle", "invalid", "nodelta", NULL };
|
||||
static char *(p_rdb_values[]) = { "compositor", "nothrottle", "invalid", "nodelta", "line",
|
||||
"flush", NULL };
|
||||
static char *(p_sloc_values[]) = { "last", "statusline", "tabline", NULL };
|
||||
|
||||
/// All possible flags for 'shm'.
|
||||
|
@@ -419,7 +419,7 @@ void ui_line(ScreenGrid *grid, int row, int startcol, int endcol, int clearcol,
|
||||
(const sattr_T *)grid->attrs + off);
|
||||
|
||||
// 'writedelay': flush & delay each time.
|
||||
if (p_wd && !(rdb_flags & RDB_COMPOSITOR)) {
|
||||
if (p_wd && (rdb_flags & RDB_LINE)) {
|
||||
// If 'writedelay' is active, set the cursor to indicate what was drawn.
|
||||
ui_call_grid_cursor_goto(grid->handle, row,
|
||||
MIN(clearcol, (int)grid->cols - 1));
|
||||
@@ -510,6 +510,10 @@ void ui_flush(void)
|
||||
pending_has_mouse = has_mouse;
|
||||
}
|
||||
ui_call_flush();
|
||||
|
||||
if (p_wd && (rdb_flags & RDB_FLUSH)) {
|
||||
os_microdelay((uint64_t)labs(p_wd) * 1000U, true);
|
||||
}
|
||||
}
|
||||
|
||||
/// Check if 'mouse' is active for the current mode
|
||||
|
Reference in New Issue
Block a user