-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Textarea optimizations #5925
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
Merged
Merged
Textarea optimizations #5925
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
13ee288
text area render optimizations
willmcgugan a5edaa5
changelog
willmcgugan 8dbf0cb
fix gutter
willmcgugan 9438bd3
simplify
willmcgugan cd53d20
extend cell length
willmcgugan 82b4944
remove comment
willmcgugan 5f8cbcd
restore console.render
willmcgugan ec0c050
line cache
willmcgugan afae638
simplify render
willmcgugan f245679
snapshots
willmcgugan 3b66e3a
pause blink tweak
willmcgugan 2af8f90
apply theme fix
willmcgugan 9267703
read only cursor
willmcgugan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). | |
| ## Changed | ||
|
|
||
| - Widget.release_mouse will now only release the mouse, if it was captured by self https://github.com/Textualize/textual/pull/5900 | ||
| - Some optimizations to TextArea, which may be noticeable during scrolling (note: may break snapshots with a TextArea) https://github.com/Textualize/textual/pull/5925 | ||
| - Selecting in the TextArea now hides the cursor until you release the mouse https://github.com/Textualize/textual/pull/5925 | ||
| - Read only TextAreas will no longer display a cursor https://github.com/Textualize/textual/pull/5925 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can still navigate and select the text in read-only mode, so don't we need the cursor? |
||
|
|
||
| ## Added | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think we also still want the cursor here, as it helps show what exactly is being selected?
For example, try selecting a line with the mouse, starting at the end of the line. If you select only until the start of that line and hit backspace, that leaves a blank line. Whereas if you select until the end of the previous line, the line is removed entirely.
When you're quickly trying to edit, after selecting the text you're probably almost immediately going to hit the next key, which is why I think the cursor context while selecting is important.
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 follow. The cursor is always directly under the mouse, which is why it feels redundant. As soon as you release the mouse the cursor reappears.
Screen.Recording.2025-07-06.at.08.15.17.mov
I'm going to merge this shortly. But if I've missed something, I'm happy to revisit it.