Suggestion for search in Xcode

Hi,

I have two points regarding the search function.

In other applications I use, it’s possible to highlight a word and then press CMD-F to have that word automatically populated into the search field. This doesn't work in Xcode, and it’s really annoying.

Secondly, it bothers me that the two search fields—the one in the sidebar and the one above the editor window—are linked; specifically, when I clear one, the other disappears as well. They serve two different purposes and should remain separate.

Christian

Hi, Christian!

As it turns out, these two complaints are actually linked to one litttle-known feature that has been part of Cocoa and the Mac for more than 20 years. It’s called the “find pasteboard” and it‘s built-in to native Mac apps by default. It lets you move pasteboard state across your system and around the same application.

To load the find bar with your current selection, you can hold the command key and press E instead of F. To advance to the next findable item with that query, you can press G instead of F.

This also means you can do a find through your document without ever needing to open the Find Bar at all — which is why it does not change its contents when you press the key combination. You may already be looking for something!

As you mentioned, find state commutes between the navigator and editors. It also commutes between applications, so you can start a search in TextEdit or BBEdit and then move to Xcode, or one of many other Cocoa apps on your Mac.

Hopefully this and all the other related power tools we try to give you in the “Find” menu help you fill the gap you feel you’re missing. I know it can be a bit of a transition into this system, and we are always evaluating which paradigms make sense to keep and which may no longer fit with how the Mac is used today, so we appreciate the feedback.

Hi!

Yes, that's right. I had never heard or read about cmd-E. It works—very nice. Many thanks.

Okay, now I’ve noticed it in Xcode’s "Find" menu as well.

My second point is that the search fields in the editor and the sidebar are linked. I want to search for different things in the editor than I do when searching across all files, yet the content of one field gets overwritten by the other.

This is particularly inconvenient when I’ve used a regex that I didn't save, only to have it overwritten.

Christian

Suggestion for search in Xcode
 
 
Q