mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Ensure we read buffer correctly in XTermParser
This commit is contained in:
@@ -15,6 +15,15 @@ from textual.events import (
|
||||
from textual.messages import TerminalSupportsSynchronizedOutput
|
||||
|
||||
|
||||
def chunks(data, size):
|
||||
chunk_start = 0
|
||||
chunk_end = size
|
||||
while chunk_end <= len(data):
|
||||
yield data[chunk_start:chunk_end]
|
||||
chunk_start = chunk_end
|
||||
chunk_end += size
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def parser():
|
||||
return XTermParser(sender=mock.sentinel, more_data=lambda: False)
|
||||
|
||||
Reference in New Issue
Block a user