-
Notifications
You must be signed in to change notification settings - Fork 15
✨ Find/Replace in Document #1
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
Comments
@RayZhao1998 Would you like to tackle this one since find is fresh on your mind? |
Yep, assigned to me. |
Moved this issue into CodeEditTextView. @lukepistrol Work has been done in the past on this. Now that we are working on a new editor view will this need to be done again or can this work translate over? |
It looks like we have Find/Replace however it does not look the same as Xcode. Created #3. |
Improved Appearance of Line Numbers
Can I work on it? |
I believe @tom-ludwig is working on this one. Is that correct? |
We are currently trying to figure out how that one will work. The find/replace bar UI will need views from CodeEditUI which is currently (at the time of posting) in the CodeEdit repository. We may consider breaking it out in it's own package if it has to be shared. I will follow this up with a discussion with @maintainers in our Discord server on the development channel. |
@austincondiff Yeah, I’ve been working on this. But @nis-ship-it, feel free to handle the UI if you want! I’ve got a great algorithm in place, but the UI is tricky for me since I don’t use AppKit much. If you open a pull request that’s only for the UI, we can avoid duplicating efforts. |
I imagine we could use SwiftUI for the UI, but I guess it depends on what is possible/easier/better. |
@tom-ludwig no worries I would try to work on the UI. Just to confirm UI is dealt on CodeEdit repo |
Please implement the UI in this repository since other projects might need the search too. Even though we’re considering adding a separate CodeEditUI repo, I think it’s fine to go ahead and implement the UI here for now. |
> [!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>
…xes (#2020) ### Description Updates CodeEditSourceEditor. Includes: - Find in Editor feature. - Improved undo grouping. - Improved word detection when selecting words. - Improved overscroll behavior. - Added mouse drag selection modes. ### Related Issues * CodeEditApp/CodeEditTextView#1 * CodeEditApp/CodeEditSourceEditor#295 ### Checklist - [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
Description
We should allow users to search for text within the currently open document and optionally replace matching instances.
Additional Context
Users can search for text occurrences in the current file. Matching results should be highlighted.
Users should have the option to replace individual or all instances of the matching text within the document.
This should integrate into the existing Source Editor UI. A search bar should appear when the user initiates the find by pressing ⌘ F, where users can input both search and replacement strings.
The find bar will then appear at the top of the active source editor and consists of the following components:
All found instances should be clearly highlighted, with the currently selected match being prominently highlighted for easy navigation.
HUD Behavior
The HUD will provide visual feedback for users when navigating through occurrences:
Looping Navigation:
arrow.triangle.capsulepath
symbol, indicating that the bottom of the document has been reached and navigation has looped back to the first occurrence.arrow.triangle.capsulepath
symbol should be displayed in the HUD, indicating that the top of the document has been reached and navigation has looped back to the last occurrence.End of Document:
arrow.down.to.line
, signaling that the end of the document has been reached with no further results.This HUD behavior will help users understand the state of their search, particularly when reaching the beginning or end of the document, or when no additional occurrences are found.
Screenshots
The text was updated successfully, but these errors were encountered: