-
Notifications
You must be signed in to change notification settings - Fork 12
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
✨ Emphasis API for Highlighting Text Ranges #62
base: main
Are you sure you want to change the base?
Conversation
…14 to support conversion to `CGPath`
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.
Just a spelling error and a file placement suggestion. That smooth path function is beautiful, awesome stuff.
Excellent work @tom-ludwig! It looks really good. Just a small detail—the animation looks a little off. Instead of scaling it, it seems to be translated from below and to the right. Can we fix this? |
@austincondiff Yeah, it’s not what Xcode is using, but honestly, I’m not really a fan of Xcode’s approach. I’ll experiment with the animation to come up with something better. |
Xcodes approach is a macOS standard found in many other apps. I’d like to first start with it and if we want to, later on adjust as needed. |
Description
This PR introduces the Emphasis API to highlight specific text ranges within a TextView. This functionality can be used in various scenarios, such as highlighting search results, emphasizing code symbols, or highlighting the code symbol that the mouse is hovering over.
This PR only introduces the Emphasis API and does not include any search functionality or text-range validation (e.g., checking if an already emphasized range has changed).
Note
To test the UI changes, you will likely need to use CESE and add CETE as a local package.
To experiment with the highlighting, add the following snippet to
TextView+KeyDown
at line13
and change the ranges accordingly:Related Issues
Checklist
Screenshots
Screen.Recording.2024-11-25.at.8.46.32.PM.mov
Multiline: