mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 16:25:00 +00:00
feat: Continue spinner animation across instances
This commit is contained in:
parent
b236e0c801
commit
9ef506dc25
1 changed files with 4 additions and 1 deletions
|
@ -258,6 +258,8 @@ class Spinner:
|
|||
cannot display unicode the frames are converted to plain ASCII.
|
||||
"""
|
||||
|
||||
last_frame_idx = 0 # Class variable to store the last frame index
|
||||
|
||||
def __init__(self, text: str, width: int = 7):
|
||||
self.text = text
|
||||
self.start_time = time.time()
|
||||
|
@ -292,7 +294,7 @@ class Spinner:
|
|||
|
||||
# Bounce the scanner back and forth.
|
||||
self.frames = frames
|
||||
self.frame_idx = 0
|
||||
self.frame_idx = Spinner.last_frame_idx # Initialize from class variable
|
||||
self.scan_char = scan_char
|
||||
self.width = len(frames[0]) - 2 # number of chars between the brackets
|
||||
self.animation_len = len(frames[0])
|
||||
|
@ -312,6 +314,7 @@ class Spinner:
|
|||
def _next_frame(self) -> str:
|
||||
frame = self.frames[self.frame_idx]
|
||||
self.frame_idx = (self.frame_idx + 1) % len(self.frames)
|
||||
Spinner.last_frame_idx = self.frame_idx # Update class variable
|
||||
return frame
|
||||
|
||||
def step(self) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue