Skip to content

Commit ee19d95

Browse files
committed
Store PyREPL display snapshots by logical line
1 parent 9fe52e9 commit ee19d95

3 files changed

Lines changed: 128 additions & 254 deletions

File tree

‎Lib/_pyrepl/historical_reader.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,13 @@ def prepare(self) -> None:
319319
self.restore()
320320
raise
321321

322-
def get_prompt(self, lineno: int, cursor_on_line: bool) -> str:
322+
def _prompt_for_line(
323+
self, lineno: int, cursor_on_line: bool, *, last_lineno: int | None,
324+
) -> str:
323325
if cursor_on_line and self.isearch_direction != ISEARCH_DIRECTION_NONE:
324326
d = "rf"[self.isearch_direction == ISEARCH_DIRECTION_FORWARDS]
325327
return "(%s-search `%s') " % (d, self.isearch_term)
326-
else:
327-
return super().get_prompt(lineno, cursor_on_line)
328+
return super()._prompt_for_line(lineno, cursor_on_line, last_lineno=last_lineno)
328329

329330
def search_next(self, *, forwards: bool) -> None:
330331
"""Search history for the current line contents up to the cursor.

0 commit comments

Comments
 (0)