Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.
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
eae92aaCompareThis test does not work yet :-(
Uh oh!
There was an error while loading. Please reload this page.
99af855 to
dd90c2eComparedanielhollas
commented
Jun 3, 2024
@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. |
pablogsal
commented
Jun 3, 2024
CC @lysnikolaou as he was working on something like this for a bugfix |
lysnikolaou
left a comment
There was a problem hiding this comment.
Thanks for working on this @danielhollas!
Uh oh!
There was an error while loading. Please reload this page.
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
af90634Comparedanielhollas
commented
Jun 24, 2024
@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. |
Uh oh!
There was an error while loading. Please reload this page.
f1e76ce to
aa9a3a3Comparepablogsal
commented
Jan 21, 2025
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) |
pablogsal
commented
Jan 21, 2025
@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. |
pablogsal
commented
Jan 21, 2025
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