diff options
author | Nikita Slyusarev <nslus@yandex-team.com> | 2022-02-10 16:46:53 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:53 +0300 |
commit | 469afdc4e2587bf62ecdd096b75a0baa444c4012 (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/prompt.py | |
parent | cd77cecfc03a3eaf87816af28a33067c4f0cdb59 (diff) | |
download | ydb-469afdc4e2587bf62ecdd096b75a0baa444c4012.tar.gz |
Restoring authorship annotation for Nikita Slyusarev <nslus@yandex-team.com>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/prompt.py')
-rw-r--r-- | contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/prompt.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/prompt.py b/contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/prompt.py index 2a1373efbb..7d00ec513e 100644 --- a/contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/prompt.py +++ b/contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/prompt.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals from six import text_type from prompt_toolkit.enums import IncrementalSearchDirection, SEARCH_BUFFER -from prompt_toolkit.token import Token +from prompt_toolkit.token import Token from .utils import token_list_len from .processors import Processor, Transformation @@ -45,7 +45,7 @@ class DefaultPrompt(Processor): return [(Token.Prompt, message)] return cls(get_message_tokens) - def apply_transformation(self, cli, document, lineno, source_to_display, tokens): + def apply_transformation(self, cli, document, lineno, source_to_display, tokens): # Get text before cursor. if cli.is_searching: before = _get_isearch_tokens(cli) @@ -59,11 +59,11 @@ class DefaultPrompt(Processor): # Insert before buffer text. shift_position = token_list_len(before) - # Only show the prompt before the first line. For the following lines, - # only indent using spaces. - if lineno != 0: - before = [(Token.Prompt, ' ' * shift_position)] - + # Only show the prompt before the first line. For the following lines, + # only indent using spaces. + if lineno != 0: + before = [(Token.Prompt, ' ' * shift_position)] + return Transformation( tokens=before + tokens, source_to_display=lambda i: i + shift_position, |