mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Revisit out_data_decide_throttle
Pulse every 0.1s only. This makes `!yes` look much better (less busy).
This commit is contained in:
parent
7732976918
commit
b3ab7ba1d6
@ -405,8 +405,11 @@ 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 % 20 == 0) {
|
} else {
|
||||||
uint64_t since = os_hrtime() - started;
|
uint64_t since = os_hrtime() - started;
|
||||||
|
if (since < (visit * 0.1L * NS_1_SECOND)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (since > (3 * NS_1_SECOND)) {
|
if (since > (3 * NS_1_SECOND)) {
|
||||||
received = visit = 0;
|
received = visit = 0;
|
||||||
return false;
|
return false;
|
||||||
@ -415,12 +418,10 @@ static bool out_data_decide_throttle(size_t size)
|
|||||||
|
|
||||||
visit++;
|
visit++;
|
||||||
// Pulse "..." at the bottom of the screen.
|
// Pulse "..." at the bottom of the screen.
|
||||||
size_t tick = (visit % 20 == 0)
|
size_t tick = visit % 4;
|
||||||
? 3 // Force all dots "..." on last visit.
|
pulse_msg[0] = (tick > 0) ? '.' : ' ';
|
||||||
: (visit % 4);
|
pulse_msg[1] = (tick > 1) ? '.' : ' ';
|
||||||
pulse_msg[0] = (tick == 0) ? ' ' : '.';
|
pulse_msg[2] = (tick > 2) ? '.' : ' ';
|
||||||
pulse_msg[1] = (tick == 0 || 1 == tick) ? ' ' : '.';
|
|
||||||
pulse_msg[2] = (tick == 0 || 1 == tick || 2 == tick) ? ' ' : '.';
|
|
||||||
if (visit == 1) {
|
if (visit == 1) {
|
||||||
msg_putchar('\n');
|
msg_putchar('\n');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user