diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2025-02-04 23:55:58 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2025-02-05 00:13:10 +0300 |
commit | e0149bcce6c022b2baaf22dc46dfad00080d041d (patch) | |
tree | 8d8629279ddbec4d3cbd1756cd1348c7c1d53706 /contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/processors.py | |
parent | 850bc4677d9c730e49444ba0fba91309d9cadd0b (diff) | |
download | ydb-e0149bcce6c022b2baaf22dc46dfad00080d041d.tar.gz |
Intermediate changes
commit_hash:fe9cb645107d4e98cea6850ff89242dd287facbb
Diffstat (limited to 'contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/processors.py')
-rw-r--r-- | contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/processors.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/processors.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/processors.py index b10ecf7184..666e79c66d 100644 --- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/processors.py +++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/processors.py @@ -86,6 +86,9 @@ class TransformationInput: previous processors into account.) :param fragments: List of fragments that we can transform. (Received from the previous processor.) + :param get_line: Optional ; a callable that returns the fragments of another + line in the current buffer; This can be used to create processors capable + of affecting transforms across multiple lines. """ def __init__( @@ -97,6 +100,7 @@ class TransformationInput: fragments: StyleAndTextTuples, width: int, height: int, + get_line: Callable[[int], StyleAndTextTuples] | None = None, ) -> None: self.buffer_control = buffer_control self.document = document @@ -105,6 +109,7 @@ class TransformationInput: self.fragments = fragments self.width = width self.height = height + self.get_line = get_line def unpack( self, @@ -842,9 +847,9 @@ class ReverseSearchProcessor(Processor): def apply_transformation(self, ti: TransformationInput) -> Transformation: from .controls import SearchBufferControl - assert isinstance( - ti.buffer_control, SearchBufferControl - ), "`ReverseSearchProcessor` should be applied to a `SearchBufferControl` only." + assert isinstance(ti.buffer_control, SearchBufferControl), ( + "`ReverseSearchProcessor` should be applied to a `SearchBufferControl` only." + ) source_to_display: SourceToDisplay | None display_to_source: DisplayToSource | None @@ -987,6 +992,7 @@ class _MergedProcessor(Processor): fragments, ti.width, ti.height, + ti.get_line, ) ) fragments = transformation.fragments |