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/controls.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/controls.py')
-rw-r--r-- | contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/controls.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/controls.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/controls.py index 222e471c57..5083c8286d 100644 --- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/controls.py +++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/controls.py @@ -667,7 +667,11 @@ class BufferControl(UIControl): merged_processor = merge_processors(input_processors) - def transform(lineno: int, fragments: StyleAndTextTuples) -> _ProcessedLine: + def transform( + lineno: int, + fragments: StyleAndTextTuples, + get_line: Callable[[int], StyleAndTextTuples], + ) -> _ProcessedLine: "Transform the fragments for a given line number." # Get cursor position at this line. @@ -679,7 +683,14 @@ class BufferControl(UIControl): transformation = merged_processor.apply_transformation( TransformationInput( - self, document, lineno, source_to_display, fragments, width, height + self, + document, + lineno, + source_to_display, + fragments, + width, + height, + get_line, ) ) @@ -697,7 +708,7 @@ class BufferControl(UIControl): try: return cache[i] except KeyError: - processed_line = transform(i, get_line(i)) + processed_line = transform(i, get_line(i), get_line) cache[i] = processed_line return processed_line |