[neovim] 08/11: out_data_decide_throttle(): Avoid too-small final chunk.

James McCoy jamessan at debian.org
Sat Dec 24 21:14:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch debian/sid
in repository neovim.

commit ea446196c74f936b85bb28a55715a459e2a55381
Author: Justin M. Keyes <justinkz at gmail.com>
Date:   Sat Oct 8 16:03:26 2016 +0200

    out_data_decide_throttle(): Avoid too-small final chunk.
---
 src/nvim/os/shell.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c
index f7325b2..d3fd4f8 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) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vim/neovim.git



More information about the pkg-vim-maintainers mailing list