Skip to content

Commit

Permalink
Merge pull request #8055 from bfredl/strictwritedelay
Browse files Browse the repository at this point in the history
make 'writedelay' show all redraws when negative
  • Loading branch information
bfredl committed Feb 24, 2018
2 parents f3f1970 + e181776 commit f72630b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions runtime/doc/options.txt
Expand Up @@ -6922,7 +6922,8 @@ A jump table for the options with a short description can be found at |Q_op|.
'writedelay' 'wd' number (default 0)
global
The number of milliseconds to wait for each character sent to the
screen. When non-zero, characters are sent to the terminal one by
one. For debugging purposes.
screen. When positive, characters are sent to the UI one by one.
When negative, all redrawn characters cause a delay, even if the
character already was displayed by the UI. For debugging purposes.

vim:tw=78:ts=8:ft=help:noet:norl:
3 changes: 2 additions & 1 deletion src/nvim/screen.c
Expand Up @@ -4361,7 +4361,8 @@ static int char_needs_redraw(int off_from, int off_to, int cols)
&& comp_char_differs(off_from, off_to))
|| ((*mb_off2cells)(off_from, off_from + cols) > 1
&& ScreenLines[off_from + 1]
!= ScreenLines[off_to + 1])))));
!= ScreenLines[off_to + 1])))
|| p_wd < 0));
}

/*
Expand Down
5 changes: 2 additions & 3 deletions src/nvim/ui.c
Expand Up @@ -437,9 +437,8 @@ void ui_puts(uint8_t *str)

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);
uint64_t wd = (uint64_t)labs(p_wd);
os_delay(wd, false);
}
}
}
Expand Down

0 comments on commit f72630b

Please sign in to comment.