Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Conversation

@smashwilson
Copy link
Contributor

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

In atom/github, we open several pane items that embed TextEditor elements, but are not TextEditors themselves: ChangedFileItems for single file diffs (stage and unchanged), CommitPreviewItems for commit previews, and the "Files Changed" tab within the pull request detail item. Cmd-F doesn't search them, which is inconvenient, because especially the last two can be large.

To accommodate them, and any other packages that created pane items with internal TextEditors, I'm allowing pane items to implement a getEmbeddedTextEditor() method. If present on the active pane item, when the find view is opened, that embedded item will be searched.

Alternate Designs

I thought about making the method getEmbeddedTextEditors(), plural, and allowing a pane item to return multiple editors and search across all of them. It would have been a fair bit more work and we didn't actually need it for atom/github, so I held off to keep the scope small.

Benefits

find-and-replace:show will be able to be used to search buffers embedded in custom pane items as well as core TextEditors.

Possible Drawbacks

It's possible that there are items in third-party packages that already implement a method with that name. Although this is kind of a bonus too?

Applicable Issues

N/A

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants