selectWord/selectParagraph when selection is at the end of the content #93
Closed
barnettben
started this conversation in
Questions
Replies: 2 comments 3 replies
-
|
Thank you for bringing that to my attention. I just notice that while it is indeed just like you described in the NSTextView (and TextEdit), the Xcode editor behaves differently (like STTextView): Screen.Recording.2025-10-31.at.19.05.05.mov |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Fixed (changed) in 2.2.5 Screen.Recording.2025-11-01.at.02.50.37.mov |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Double/triple-clicking to select a word/line works the same way as NSTextView, except when the clicks happen at or past the end of the content.
If you triple-click in the whitespace beyond the end of any text content, the first click moves the insertion point to the end, but the next two clicks don't highlight the final word/line.
It looks like
textSelection(for:enclosing:)doesn't work properly when the insertion point is at the end of the text content. It just keeps the same selection.I've got a proposed solution, but it's a bit annoying:
In
selectWord/selectParagraph/selectLine, we could detect if the current selection is at the end, and if so, move it back a character before trying to select the word/paragraph/line.I've done a quick experiment, and the behaviour does seem better. Would you be interested in a PR with this workaround?
Beta Was this translation helpful? Give feedback.
All reactions