aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/README.md6
-rw-r--r--src/nvim/ui.c7
2 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/README.md b/src/nvim/README.md
index 1ece92e44d..d668db0cdc 100644
--- a/src/nvim/README.md
+++ b/src/nvim/README.md
@@ -90,6 +90,12 @@ Record a Nvim terminal session and format it with `vterm-dump`:
Then you can compare `bar` with another session, to debug TUI behavior.
+### TUI redraw
+
+Set the 'writedelay' option to see where and when the UI is painted.
+
+ :set writedelay=1
+
### Terminal reference
- `man terminfo`
diff --git a/src/nvim/ui.c b/src/nvim/ui.c
index 8aec923538..709a172449 100644
--- a/src/nvim/ui.c
+++ b/src/nvim/ui.c
@@ -453,6 +453,13 @@ void ui_puts(uint8_t *str)
ui_linefeed();
}
p += clen;
+
+ if (p_wd) { // 'writedelay': flush & delay each time.
+ ui_flush();
+ assert(p_wd >= 0
+ && (sizeof(long) <= sizeof(uint64_t) || p_wd <= UINT64_MAX));
+ os_delay((uint64_t)p_wd, false);
+ }
}
}