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

Conversation

@tbrockman
Copy link

@tbrockman tbrockman commented Jul 22, 2017

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

Added two context-menu options to right clicking on the paths of search results, "Open in New Tab" and "Open in New Window".

image

Can also open new tabs on specific line matches, and already opened tabs will becomes focused after subsequent open attempts:

image

Note: Open in New Window not implemented for specific line matches as this does not appear to be easily accomplished within the current API.

Includes tests to guarantee that the context menu commands call the
correct functions with the intended parameters, as well as ensure that
right-clicks have no unexpected consequences with the new functionality (such as
expanding and contracting of selected results). But it should be noted that I'm still familiarizing myself with the API and tests, so it's possible that the tests may not be entirely accurate due to that lack of familiarity.

Alternate Designs

None.

Benefits

Ability to open multiple results from directory searches without being required to navigate back to search results view. Allows for some nice window and tab organization and facilitates workflows that involve opening and editing multiple files matching certain search criteria.

Possible Drawbacks

People who frequently use "Copy" and "Copy Path" might accidentally click on the newly added menu options.

Applicable Issues

N/A. This was just a feature I'd wanted myself in the past, ideally others find it useful.

@winstliu
Copy link
Contributor

I think for this feature to be useful for me it'd need to have the context menu show up on individual results as well.

Fixes might include forcing the tab into focus when a new tab is selected

I think this makes the most sense.

@tbrockman
Copy link
Author

That's fair, I'll work that into the pull request.

Now opening new tabs to a specific line is already supported by the Atom API, but do you know if there exists any sort of way to do the same with a new Atom window?

@tbrockman tbrockman force-pushed the context branch 4 times, most recently from 7d3c76d to 5cf751b Compare August 20, 2018 05:49
options to find-and-replace results.

Include tests to guarantee that the context menu commands call the
correct functions with the intended parameters, as well as ensure that
right-clicks have no unexpected consequences with the new functionality
(such as expanding and contracting of selected results).
@tbrockman
Copy link
Author

tbrockman commented Aug 20, 2018

Came back to update the code I'd written, fixed merge conflicts, updated calls to no longer existing functions, and then squashed everything into one neat commit.

If there's anything that needs to be changed or added in terms of tests or code in order for this to be merged, please let me know.

@lee-dohm
Copy link
Contributor

lee-dohm commented Sep 4, 2018

Thanks for the help! Apologies for taking so long to get back to you.

  • Please remove Open in New Window since it isn't completely implemented
  • Please rename command to find-and-replace:open-in-new-tab

Thanks again for the contribution!

…open-in-window' command as well as its corresponding test.
@tbrockman
Copy link
Author

No worries, glad to hear back!

Done and done, let me know if there's anything else.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants