Skip to content
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

Readline leaves text behind when moving from a long line to a shorter line #148

Closed
jmmv opened this issue Dec 8, 2021 · 1 comment · Fixed by #149
Closed

Readline leaves text behind when moving from a long line to a shorter line #148

jmmv opened this issue Dec 8, 2021 · 1 comment · Fixed by #149
Labels
bug Something isn't working

Comments

@jmmv
Copy link
Collaborator

jmmv commented Dec 8, 2021

When moving from a long line to a shorter line in the REPL using the up/down arrow keys, the previous contents of the line aren't properly cleared. This is a recent regression in 0.8.0, as I modified the readline logic to be "smarter" and not clear the whole line every time (to not mangle existing graphical output, if any).

@jmmv jmmv added the bug Something isn't working label Dec 8, 2021
@jmmv
Copy link
Collaborator Author

jmmv commented Dec 8, 2021

Forgot to mention that this only happens when the cursor is not at the end of the line (i.e. it's in the middle of the long line), which is why the current tests didn't catch the problem.

jmmv added a commit that referenced this issue Dec 8, 2021
The old logic to clear the previous line assumed that the cursor was at the
end of the line that had to be cleared, which means we left characters behind
when the cursor was not at the end.  Fix that now and add a test.

Fixes #148.
@jmmv jmmv closed this as completed in #149 Dec 8, 2021
jmmv added a commit that referenced this issue Dec 8, 2021
The old logic to clear the previous line assumed that the cursor was at the
end of the line that had to be cleared, which means we left characters behind
when the cursor was not at the end.  Fix that now and add a test.

Fixes #148.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant