From ed37136c5c85fbcbf98a071330025b3b0edbd065 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 29 Feb 2016 05:04:59 -0500 Subject: UI: restore 'writedelay' feature. Removed by e0e41b30c61922e099a067ac5c137e745699a1aa, probably unintentionally. Useful for ye olde redraw debugging. TODO: Also delay redraw of statusline. --- src/nvim/README.md | 6 ++++++ src/nvim/ui.c | 7 +++++++ 2 files changed, 13 insertions(+) (limited to 'src') 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); + } } } -- cgit