Repository navigation
[3.14] gh-69605: fix PyREPL completions inserted for import statements with spaces (GH-148629) - #162046
[3.14] gh-69605: fix PyREPL completions inserted for import statements with spaces (GH-148629)#162046hugovk wants to merge 3 commits into
Conversation
…tements with spaces (pythonGH-148629) Fix `from math .<tab>` inserting `from math .ath.integer` instead of `from math.integer` (cherry picked from commit 488ce0f) Co-authored-by: Loïc Simon <loic.simon@napta.io>
| last_word = line.split(" ")[-1] | ||
| if not last_word: | ||
| return completion | ||
| index = completion.rfind(last_word) |
There was a problem hiding this comment.
With apkg/foofoo.py, import apkg. foo<Tab> completes to foo. rfind() picks the second occurrence. Can we use the parser's replacement boundary here? This also affects main and 3.15.
There was a problem hiding this comment.
@loic-simon This is a backport of your #148629, would you like to followup here? Thanks!
There was a problem hiding this comment.
Sure, I'll take a look!
There was a problem hiding this comment.
I've merged hugovk#88 which has updated this PR.
|
When you're done making the requested changes, leave the comment: And if you don't make the requested changes, you will be put in the comfy chair! |
… with spaces edge cases
…ith spaces (edge cases) (#88)
|
I have made the requested changes; please review again |
Fix
from math .<tab>insertingfrom math .ath.integerinstead offrom math.integer(cherry picked from commit 488ce0f)