Skip to content

Commit ec2784d

Browse files
committed
Add styling fixes
1 parent b419b95 commit ec2784d

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/prompt_toolkit/layout/containers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from abc import ABCMeta, abstractmethod
1111
from enum import Enum
1212
from functools import partial
13-
from typing import TYPE_CHECKING, Callable, Sequence, Tuple, Union, cast
13+
from typing import TYPE_CHECKING, Callable, Sequence, Union, cast
1414

1515
from prompt_toolkit.application.current import get_app
1616
from prompt_toolkit.cache import SimpleCache
@@ -1967,7 +1967,7 @@ def _whitespace_wrap_finder(
19671967

19681968
def wrap_finder(
19691969
lineno: int, start: int, end: int
1970-
) -> Tuple[int, int, AnyFormattedText]:
1970+
) -> tuple[int, int, AnyFormattedText]:
19711971
line = explode_text_fragments(ui_content.get_line(lineno))
19721972
cont_reserved = 0
19731973
while cont_reserved < cont_width:
@@ -2001,7 +2001,7 @@ def _copy_body(
20012001
has_focus: bool = False,
20022002
align: WindowAlign = WindowAlign.LEFT,
20032003
get_line_prefix: Callable[[int, int], AnyFormattedText] | None = None,
2004-
wrap_finder: Callable[[int, int, int], Tuple[int, int, AnyFormattedText] | None]
2004+
wrap_finder: Callable[[int, int, int], tuple[int, int, AnyFormattedText] | None]
20052005
| None = None,
20062006
) -> tuple[dict[int, tuple[int, int]], dict[tuple[int, int], tuple[int, int]]]:
20072007
"""
@@ -2030,7 +2030,7 @@ def find_next_wrap(remaining_width, is_input, lineno, fragment=0, char_pos=0):
20302030

20312031
line = ui_content.get_line(lineno)
20322032
style0, text0, *more = line[fragment]
2033-
fragment_pos = char_pos - fragment_list_len(line[:fragment])
2033+
char_pos - fragment_list_len(line[:fragment])
20342034
line_part = [(style0, text0[char_pos:], *more), *line[fragment + 1 :]]
20352035
line_width = [fragment_list_width([fragment]) for fragment in line_part]
20362036

src/prompt_toolkit/layout/controls.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import time
88
from abc import ABCMeta, abstractmethod
9-
from typing import TYPE_CHECKING, Callable, Hashable, Iterable, NamedTuple
9+
from typing import TYPE_CHECKING, Callable, Hashable, Iterable, NamedTuple, Tuple
1010

1111
from prompt_toolkit.application.current import get_app
1212
from prompt_toolkit.buffer import Buffer
@@ -40,8 +40,6 @@
4040
merge_processors,
4141
)
4242

43-
from typing import Tuple
44-
4543
if TYPE_CHECKING:
4644
from prompt_toolkit.key_binding.key_bindings import (
4745
KeyBindingsBase,

0 commit comments

Comments
 (0)