CodeEditTextView icon indicating copy to clipboard operation
CodeEditTextView copied to clipboard

✨ Find/Replace in Document

Open austincondiff opened this issue 2 years ago • 5 comments

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:

  • Find Options picker, options include:
    • Find
    • Replace
    • Recents List (recents should be completed with a separate issue)
    • Clear Recents
    • Wrap Around
  • Text field
  • Result count (visible when there are results)
  • Clear text button (visible when text is present)
  • Insert Pattern button (this should be completed with a separate issue)
  • Case-sensitive toggle
  • Match style picker, options include:
    • Contains
    • Matches Word
    • Starts With
    • Ends With
    • Regular Expression

All found instances should be clearly highlighted, with the currently selected match being prominently highlighted for easy navigation.

Screenshots

image

image

austincondiff avatar Mar 22 '22 17:03 austincondiff

@RayZhao1998 Would you like to tackle this one since find is fresh on your mind?

austincondiff avatar Mar 22 '22 17:03 austincondiff

Yep, assigned to me.

RayZhao1998 avatar Mar 22 '22 18:03 RayZhao1998

Just a quick consideration, when a query has been entered in the Find input, pressing next after the last result will loop back to the first result and display a temporary HUD symbol in the center of the current editor pane.

austincondiff avatar Mar 25 '22 15:03 austincondiff

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?

austincondiff avatar Jun 24 '22 22:06 austincondiff

It looks like we have Find/Replace however it does not look the same as Xcode. Created CodeEditApp/CodeEditTextView#3.

austincondiff avatar Sep 29 '22 02:09 austincondiff