|
10 | 10 | from abc import ABCMeta, abstractmethod
|
11 | 11 | from enum import Enum
|
12 | 12 | 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 |
14 | 14 |
|
15 | 15 | from prompt_toolkit.application.current import get_app
|
16 | 16 | from prompt_toolkit.cache import SimpleCache
|
@@ -1967,7 +1967,7 @@ def _whitespace_wrap_finder(
|
1967 | 1967 |
|
1968 | 1968 | def wrap_finder(
|
1969 | 1969 | lineno: int, start: int, end: int
|
1970 |
| - ) -> Tuple[int, int, AnyFormattedText]: |
| 1970 | + ) -> tuple[int, int, AnyFormattedText]: |
1971 | 1971 | line = explode_text_fragments(ui_content.get_line(lineno))
|
1972 | 1972 | cont_reserved = 0
|
1973 | 1973 | while cont_reserved < cont_width:
|
@@ -2001,7 +2001,7 @@ def _copy_body(
|
2001 | 2001 | has_focus: bool = False,
|
2002 | 2002 | align: WindowAlign = WindowAlign.LEFT,
|
2003 | 2003 | 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] |
2005 | 2005 | | None = None,
|
2006 | 2006 | ) -> tuple[dict[int, tuple[int, int]], dict[tuple[int, int], tuple[int, int]]]:
|
2007 | 2007 | """
|
@@ -2030,7 +2030,7 @@ def find_next_wrap(remaining_width, is_input, lineno, fragment=0, char_pos=0):
|
2030 | 2030 |
|
2031 | 2031 | line = ui_content.get_line(lineno)
|
2032 | 2032 | style0, text0, *more = line[fragment]
|
2033 |
| - fragment_pos = char_pos - fragment_list_len(line[:fragment]) |
| 2033 | + char_pos - fragment_list_len(line[:fragment]) |
2034 | 2034 | line_part = [(style0, text0[char_pos:], *more), *line[fragment + 1 :]]
|
2035 | 2035 | line_width = [fragment_list_width([fragment]) for fragment in line_part]
|
2036 | 2036 |
|
|
0 commit comments