-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-118878: Pyrepl: show completions menu below the current line #118939
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
gh-118878: Pyrepl: show completions menu below the current line #118939
Conversation
A crash of the new pyrepl was triggered by pressing up arrow when tab completion menu was displayed.
The main advantage of this is that the behaviour is less janky, since the current line no longer jumps up and down. This also allows fixing the behaviour of arrow keys when the menu is displayed.
a1d95c9
to
eae92aa
Compare
This test does not work yet :-(
This reverts commit 9e2170c.
99af855
to
dd90c2e
Compare
@pablogsal would you mind adding the I am not sure there is enough time to get this in for next beta, but I am happy to work on this further if this is something people are happy with. |
CC @lysnikolaou as he was working on something like this for a bugfix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @danielhollas!
This has the problem that if the cursor is on the last line of the screen, completions are not shown (only when editing a multi-line block) |
f29168e
to
af90634
Compare
@pablogsal was your comment meant on my version of the code or on @lysnikolaou patch proposed in #118939 (comment)? I can reproduce the issue you describe with his patch but I cannot with the current version of PR. I merged in main and fixed up a test, and things still seem to be working. |
f1e76ce
to
aa9a3a3
Compare
Thanks for your contribution @danielhollas |
Thanks for merging @pablogsal! I wonder if this should be back ported to 3.13? It is a somewhat large behavioural change but it does fix a couple of small bugs affecting cursor positioning while the completions menu is displayed (#119257 and #126851) |
@ambv what do you think? |
Thanks @danielhollas for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…pythonGH-118939) (cherry picked from commit 29caec6) Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
GH-129161 is a backport of this pull request to the 3.13 branch. |
I will create the backport to see if it applies cleanly |
As proposed in #118878, it feels much more natural to me to display the completions menu below the current line, not above. The main advantage of this is that the UI is less janky,
since the current line that is being edited no longer jumps up and down.
This also allows fixing the behaviour of arrow keys when the menu is displayed, described in #119257.
The current behaviour is still not great when tab completing in the middle of multiline edit, but it is at least not worse as before AFAIK. I think ultimately this should be solved by separating out the completions menu, like ipython does it, but that seems outside of scope for this PR.
TODO:
Closes #119257. Closes #118878