| 302 | self.history[:] = old_history |
| 303 | |
| 304 | def prepare(self) -> None: |
| 305 | super().prepare() |
| 306 | try: |
| 307 | self.transient_history = {} |
| 308 | if self.next_history is not None and self.next_history < len(self.history): |
| 309 | self.historyi = self.next_history |
| 310 | self.buffer[:] = list(self.history[self.next_history]) |
| 311 | self.pos = len(self.buffer) |
| 312 | self.transient_history[len(self.history)] = "" |
| 313 | else: |
| 314 | self.historyi = len(self.history) |
| 315 | self.next_history = None |
| 316 | except: |
| 317 | self.restore() |
| 318 | raise |
| 319 | |
| 320 | def get_prompt(self, lineno: int, cursor_on_line: bool) -> str: |
| 321 | if cursor_on_line and self.isearch_direction != ISEARCH_DIRECTION_NONE: |