Skip to content

gh-123177: Fix prompt for wrapped lines in pyrepl #123324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

godlygeek
Copy link
Contributor

@godlygeek godlygeek commented Aug 25, 2024

When display lines above the cursor come from the cache, the first line to not come from the cache may be a wrapped line, starting half way through a logical line in the buffer. Detect and handle this case to avoid accidentally drawing a stray prompt in the middle of a logical line.

When display lines above the cursor come from the cache, the first line
to not come from the cache may be a wrapped line, starting half way
through a logical line in the buffer. Detect and handle this case to
avoid accidentally drawing a stray prompt in the middle of a logical
line.
@pablogsal
Copy link
Member

Tested locally in a bunch of different terminals and also checked that doesn't impact performance of Frankenstein pasting :)

@pablogsal pablogsal enabled auto-merge (squash) August 25, 2024 22:50
@pablogsal pablogsal added the needs backport to 3.13 bugs and security fixes label Aug 25, 2024
@pablogsal pablogsal merged commit 602fcf9 into python:main Aug 25, 2024
46 checks passed
@miss-islington-app
Copy link

Thanks @godlygeek for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 25, 2024
)

When display lines above the cursor come from the cache, the first line
to not come from the cache may be a wrapped line, starting half way
through a logical line in the buffer. Detect and handle this case to
avoid accidentally drawing a stray prompt in the middle of a logical
line.
(cherry picked from commit 602fcf9)

Co-authored-by: Matt Wozniski <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Aug 25, 2024

GH-123327 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Aug 25, 2024
@godlygeek godlygeek deleted the fix_prompt_for_wrapped_lines_in_pyrepl branch August 25, 2024 23:40
pablogsal pushed a commit that referenced this pull request Aug 26, 2024
…123327)

gh-123177: Fix prompt for wrapped lines in pyrepl (GH-123324)

When display lines above the cursor come from the cache, the first line
to not come from the cache may be a wrapped line, starting half way
through a logical line in the buffer. Detect and handle this case to
avoid accidentally drawing a stray prompt in the middle of a logical
line.
(cherry picked from commit 602fcf9)

Co-authored-by: Matt Wozniski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants