diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-10-08 16:03:26 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-12-10 01:26:34 +0100 |
commit | ea154dfdb233db3e78a0347a7435ff4d547934a5 (patch) | |
tree | 22dca23be251fb39252b34c754989aabbc38bbbe /src | |
parent | cb589990079a0e58bed3e1831f70baaba52f66fc (diff) | |
download | rneovim-ea154dfdb233db3e78a0347a7435ff4d547934a5.tar.gz rneovim-ea154dfdb233db3e78a0347a7435ff4d547934a5.tar.bz2 rneovim-ea154dfdb233db3e78a0347a7435ff4d547934a5.zip |
out_data_decide_throttle(): Avoid too-small final chunk.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/os/shell.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index f7325b20f2..d3fd4f87fb 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -348,7 +348,7 @@ static bool out_data_decide_throttle(size_t size) static char pulse_msg[] = { ' ', ' ', ' ', '\0' }; if (!size) { - bool previous_decision = (visit > 0); // TODO: needs to check that last print shows more than a page + bool previous_decision = (visit > 0); started = received = visit = 0; max_visits = 20; return previous_decision; @@ -361,6 +361,10 @@ static bool out_data_decide_throttle(size_t size) return false; } else if (!visit) { started = os_hrtime(); + } else if (visit >= max_visits && size < 256 && max_visits < 999) { + // Gobble up small chunks even if we maxed out. Avoids the case where the + // final displayed chunk is very tiny. + max_visits = visit + 1; } else if (visit >= max_visits) { uint64_t since = os_hrtime() - started; if (since < NS_1_SECOND) { |