Skip to content

Emphasis Manager Enhancements #78

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 21 commits into from
Apr 6, 2025
Merged

Emphasis Manager Enhancements #78

merged 21 commits into from
Apr 6, 2025

Conversation

austincondiff
Copy link
Contributor

@austincondiff austincondiff commented Mar 31, 2025

Description

Renamed EmphasizeAPI to EmphasisManager. It now supports various emphasis styles including standard highlights, underlines, and outlines, with optional behaviors such as flashing, selection, and inactive styling.

Key Features:

  • EmphasisStyle enum for flexible styling (standard, underline, outline)
  • Emphasis struct to represent emphasis metadata (range, style, flash, etc.)
  • EmphasisManager class to:
    • Add, replace, and update emphases by group ID
    • Apply animations (e.g. pop, fade-out)
    • Handle selection and scrolling
    • Sync emphasis layer bounds with text layout
  • Internal caching of selection color and support for inactive visual state

This enables visual feedback for features like search highlights, bracket pair emphasis, and other temporary visual cues in the editor.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

image

austincondiff and others added 5 commits March 13, 2025 10:48
…match cycle logic from EmphasisManager to FindViewController. Using EmphasisManager in bracket pair matching instead of custom implementation reducing duplicated code. Implemented flash find matches when clicking the next and previous buttons when the editor is in focus. `bracketPairHighlight` becomes `bracketPairEmphasis`. Fixed various find issues and cleaned up implementation.
Copy link
Contributor

@thecoolwinter thecoolwinter left a comment

Choose a reason for hiding this comment

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

Some missing weak references and questions about the selection manager and line fragment rendering changes.

tom-ludwig
tom-ludwig previously approved these changes Mar 31, 2025
Copy link
Member

@tom-ludwig tom-ludwig left a comment

Choose a reason for hiding this comment

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

LGTM

@austincondiff
Copy link
Contributor Author

Merging, @tom-ludwig previously approved.

@austincondiff austincondiff merged commit fe36e69 into main Apr 6, 2025
2 checks passed
@austincondiff austincondiff deleted the feat/in-doc-search branch April 6, 2025 15:22
thecoolwinter added a commit to CodeEditApp/CodeEditSourceEditor that referenced this pull request Apr 8, 2025
> [!IMPORTANT]
> ~~We need to merge
CodeEditApp/CodeEditTextView#78 before merging
this PR.~~

### Description

This PR introduces the initial implementation of the “Find in Editor”
feature for the source editor. Users can now search for text within the
currently open file using ⌘ F. All matching results are visually
emphasized, and users can navigate between matches using next/previous
controls.

What’s Included

- Text search across the current document
- Match highlighting with emphasis on the currently selected match
- Keyboard shortcut support: ⌘ F to activate the find bar
- Looping navigation with HUD notifications:
	- Reaching the end → loops to first result (arrow.triangle.capsulepath)
- Reaching the beginning → loops to last result (flipped
arrow.triangle.capsulepath)
	- No more matches → arrow.down.to.line HUD icon displayed

### Related Issues

- CodeEditApp/CodeEditTextView#1
- closes CodeEditApp/CodeEditTextView#3
- CodeEditApp/CodeEditTextView#78

* #ISSUE_NUMBER

### Checklist

<!--- Add things that are not yet implemented above -->

- [x] I read and understood the [contributing
guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md)
as well as the [code of
conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md)
- [x] The issues this PR addresses are related to each other
- [x] My changes generate no new warnings
- [x] My code builds and runs on my machine
- [x] My changes are all related to the related issue above
- [x] I documented my code

### Screenshots

<!--- REQUIRED: if issue is UI related -->

<!--- IMPORTANT: Fill out all required fields. Otherwise we might close
this PR temporarily -->

---------

Co-authored-by: Khan Winter <35942988+thecoolwinter@users.noreply.github.com>
Co-authored-by: Austin Condiff <austin.condiff@gmail.com>
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