mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 23:08:16 +00:00
out_data_decide_throttle(): Avoid too-small final chunk.
This commit is contained in:
@@ -348,7 +348,7 @@ static bool out_data_decide_throttle(size_t size)
|
|||||||
static char pulse_msg[] = { ' ', ' ', ' ', '\0' };
|
static char pulse_msg[] = { ' ', ' ', ' ', '\0' };
|
||||||
|
|
||||||
if (!size) {
|
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;
|
started = received = visit = 0;
|
||||||
max_visits = 20;
|
max_visits = 20;
|
||||||
return previous_decision;
|
return previous_decision;
|
||||||
@@ -361,6 +361,10 @@ static bool out_data_decide_throttle(size_t size)
|
|||||||
return false;
|
return false;
|
||||||
} else if (!visit) {
|
} else if (!visit) {
|
||||||
started = os_hrtime();
|
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) {
|
} else if (visit >= max_visits) {
|
||||||
uint64_t since = os_hrtime() - started;
|
uint64_t since = os_hrtime() - started;
|
||||||
if (since < NS_1_SECOND) {
|
if (since < NS_1_SECOND) {
|
||||||
|
Reference in New Issue
Block a user