Skip to content

Store PyREPL display snapshots by logical line - #162696

Open
pablogsal wants to merge 3 commits into
python:mainfrom
pablogsal:pyrepl-logical-line-snapshots
Open

pablogsal wants to merge 3 commits into
python:mainfrom
pablogsal:pyrepl-logical-line-snapshots

Conversation

@pablogsal

@pablogsal pablogsal commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

PyREPL keeps rendered rows, cursor layout, and source offsets in parallel lists. After a line wraps, a refresh can count screen rows as source lines and choose the wrong prompt.

Keep the rendered rows and cursor layout together in a snapshot for each logical line. Reuse the snapshot when the line text, prompt, and colors match. Edits within a wrapped line can also reuse rows whose text, colors, and wrap boundaries still match. Status messages and completion menus can reuse the base screen.

@pablogsal
pablogsal marked this pull request as ready for review November 29, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant