-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-131430: Fix crashes on an empty DELETE_WORD_BACKWARDS (^W) followed by CLEAR_TO_START (^K) #131452
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
base: main
Are you sure you want to change the base?
Conversation
…ollowed by CLEAR_TO_START (^K) Add the handling of kill_range null detection, which is a left closed and right open interval. When end start<=1, it means that no operation has been done and should be skipped; The original writing only handled the case of end==start
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
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.
@@ -58,7 +58,7 @@ def do(self) -> None: | |||
|
|||
class KillCommand(Command): | |||
def kill_range(self, start: int, end: int) -> None: | |||
if start == end: | |||
if end - start <= 1: |
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.
I don't think this is correct, consider for example this input:
>>> 12
where the cursor is over 2
. If you press ^w
, this no longer removes the 1
.
Perhaps checking that kill_ring
is not an empty list would be a good alternative?
- if is_kill(r.last_command):
+ if is_kill(r.last_command) and r.kill_ring:
Thank you for your guidance. I will try to submit a revised version again~~ I have something to ask first. I noticed that after submitting my PR for a considerable period of time, the automatically assigned reviewers do not seem to have enough time to review. In this situation, do I usually need to be patient and wait, or can I look for other reviewers? |
We are nearing the beta freeze for Python 3.14 so everybody is even busier than usual and there can be larger delays in getting reviews.. That said, I'm happy to help you review the PR, feel free to ping me once you have addressed my comment 🙂 |
Add the handling of kill_range null detection, which is a left closed and right open interval. When end start<=1, it means that no operation has been done and should be skipped; The original writing only handled the case of end==start.