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

feat: Find in Editor #295

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft

feat: Find in Editor #295

wants to merge 23 commits into from

Conversation

tom-ludwig
Copy link
Member

@tom-ludwig tom-ludwig commented Mar 13, 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

  • #ISSUE_NUMBER

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

@austincondiff austincondiff changed the title feat: Search in Document feat: Find in Editor Mar 16, 2025
thecoolwinter and others added 11 commits March 16, 2025 11:11
…hen looping find results or submitting when there is no result. Commented emphasize logic back in.
- If the users cursor is in view, the highlighted item will be next to
  the cursor
- If the users cursor is out of view, we'll highlight the closed item to
  the visibe area
…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.
…dings didnt work while find panel was in focus preventing it from being dismissed.
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