Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

deepwzh
Copy link

@deepwzh deepwzh commented Mar 19, 2025

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.

…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
@bedevere-app
Copy link

bedevere-app bot commented Mar 19, 2025

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 skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Mar 19, 2025

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 skip news label instead.

Copy link
Member

@tomasr8 tomasr8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @deepwzh! This will need a news entry and ideally a test to make sure we don't regress. Feel free to have a look at our devguide or just ask me if you need help!

@@ -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:
Copy link
Member

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:

@deepwzh
Copy link
Author

deepwzh commented Apr 30, 2025

Thanks for the PR @deepwzh! This will need a news entry and ideally a test to make sure we don't regress. Feel free to have a look at our devguide or just ask me if you need help!

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?

@tomasr8
Copy link
Member

tomasr8 commented Apr 30, 2025

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 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants