(
self,
width: int | None = None,
*,
lineno: int | None = None,
wrap_count: int | None = None,
)
| 52 | return fragment_list_width(self.in_prompt_tokens()) |
| 53 | |
| 54 | def continuation_prompt_tokens( |
| 55 | self, |
| 56 | width: int | None = None, |
| 57 | *, |
| 58 | lineno: int | None = None, |
| 59 | wrap_count: int | None = None, |
| 60 | ): |
| 61 | if width is None: |
| 62 | width = self._width() |
| 63 | line = lineno + 1 if lineno is not None else 0 |
| 64 | if wrap_count: |
| 65 | return [ |
| 66 | ( |
| 67 | Token.Prompt.Wrap, |
| 68 | # (" " * (width - 2)) + "\N{HORIZONTAL ELLIPSIS} ", |
| 69 | (" " * (width - 2)) + "\N{VERTICAL ELLIPSIS} ", |
| 70 | ), |
| 71 | ] |
| 72 | prefix = " " * len( |
| 73 | self.vi_mode() |
| 74 | ) + self.shell.prompt_line_number_format.format( |
| 75 | line=line, rel_line=line - self.current_line() - 1 |
| 76 | ) |
| 77 | return [ |
| 78 | ( |
| 79 | getattr(Token.Prompt.Continuation, f"L{lineno}"), |
| 80 | prefix + (" " * (width - len(prefix) - 5)) + "...:", |
| 81 | ), |
| 82 | (Token.Prompt.Padding, " "), |
| 83 | ] |
| 84 | |
| 85 | def rewrite_prompt_tokens(self): |
| 86 | width = self._width() |
no test coverage detected