From 3fc5cf8b9f0df4cde187080aec6567585db2bb79 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 7 Jan 2025 06:51:54 -0800 Subject: [PATCH] refactor: Replace hardcoded min_delay with 1./20 for 20fps in MarkdownStream --- aider/mdstream.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aider/mdstream.py b/aider/mdstream.py index dc2ff6e58..c97238635 100755 --- a/aider/mdstream.py +++ b/aider/mdstream.py @@ -56,7 +56,7 @@ class MarkdownStream: live = None # Rich Live display instance when = 0 # Timestamp of last update - min_delay = 0.050 # Minimum time between updates (20fps) + min_delay = 1./20 # Minimum time between updates (20fps) live_window = 6 # Number of lines to keep visible at bottom during streaming def __init__(self, mdargs=None): @@ -126,7 +126,10 @@ class MarkdownStream: return self.when = now + # time how long this takes and set min_delay to it. ai! lines = self._render_markdown_to_lines(text) + + num_lines = len(lines) # How many lines have "left" the live window and are now considered stable?