Skip to content
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

Fix a TextArea crash #4126

Merged
merged 6 commits into from
Feb 7, 2024
Merged

Fix a TextArea crash #4126

merged 6 commits into from
Feb 7, 2024

Conversation

darrenburns
Copy link
Member

The TextArea widget could crash if a replacement operation occurred while a backward selection was made, and the inserted content contained fewer lines than the content being replaced.

I've fixed this and simplified some operations which don't care about the "direction" of the selection (i.e. did you click and drag from top to bottom or bottom to top with your mouse to select text).

Also fixes an issue where the selection wasn't being correctly updated after a paste occurred.

@darrenburns darrenburns marked this pull request as ready for review February 6, 2024 16:21
Copy link
Contributor

@rodrigogiraoserrao rodrigogiraoserrao left a comment

Choose a reason for hiding this comment

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

LGTM 🐍 🚀

Copy link
Collaborator

@willmcgugan willmcgugan left a comment

Choose a reason for hiding this comment

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

Just a request for docstrings.

src/textual/widgets/_text_area.py Show resolved Hide resolved
@darrenburns darrenburns merged commit 300074d into main Feb 7, 2024
20 checks passed
@darrenburns darrenburns deleted the text-area-crash branch February 7, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants