Renamed 'open-in-new-tab' command to 'open-in-new-tab', and removed 'open-in-window' command as well as its corresponding test.
MODIFY
lib/project/results-view.js
lib/project/results-view.js
@@ -90,8 +90,7 @@ class ResultsView {
'core:confirm': this.confirmResult.bind(this),
'core:copy': this.copyResult.bind(this),
'find-and-replace:copy-path': this.copyPath.bind(this),
- 'find-and-replace:open-in-tab': this.openInTab.bind(this),
- 'find-and-replace:open-in-window': this.openInWindow.bind(this)
+ 'find-and-replace:open-in-new-tab': this.openInNewTab.bind(this),
})
);
}
@@ -529,7 +528,7 @@ class ResultsView {
atom.clipboard.write(relativePath);
}
- async openInTab() {
+ async openInNewTab() {
if (this.selectedRowIndex !== -1) {
const result = this.selectedRow();
@@ -561,18 +560,6 @@ class ResultsView {
}
}
- openInWindow() {
- const result = this.selectedRow();
- if (result) {
- atom.open({
- pathsToOpen: [result.group.result.filePath],
- newWindow: true,
- devMode: atom.inDevMode(), // open tab/window in current dev&safe mode state
- safeMode: atom.inSafeMode()
- });
- }
- }
-
expandAllResults() {
let rowIndex = 0
// Since the whole array is re-generated, this makes splices cheaper

MODIFY
menus/find-and-replace.cson
menus/find-and-replace.cson
{ 'label': 'Search in Directory', 'command': 'project-find:show-in-current-directory' }
]
'.list-item.match-row': [
- { 'label': 'Open in New Tab', 'command': 'find-and-replace:open-in-tab' }
+ { 'label': 'Open in New Tab', 'command': 'find-and-replace:open-in-new-tab' }
{ 'label': 'Copy', 'command': 'core:copy' }
{ 'label': 'Copy Path', 'command': 'find-and-replace:copy-path' }
]
'.list-item.path-row': [
- { 'label': 'Open in New Tab', 'command': 'find-and-replace:open-in-tab' }
- { 'label': 'Open in New Window', 'command': 'find-and-replace:open-in-window' }
+ { 'label': 'Open in New Tab', 'command': 'find-and-replace:open-in-new-tab' }
{ 'label': 'Copy Path', 'command': 'find-and-replace:copy-path' }
]

MODIFY
spec/results-view-spec.js
spec/results-view-spec.js
@@ -498,10 +498,10 @@ describe('ResultsView', () => {
expect(atom.views.getView(editor)).toHaveFocus();
});
- it("opens the file in a new non-active tab on 'find-and-replace:open-in-tab'", async () => {
+ it("opens the file in a new non-active tab on 'find-and-replace:open-in-new-tab'", async () => {
const resultsPane = atom.workspace.paneForURI(ResultsPaneView.URI);
const preEditors = atom.workspace.getTextEditors(); // keep track of editor list before command execution
- atom.commands.dispatch(resultsView.element, 'find-and-replace:open-in-tab');
+ atom.commands.dispatch(resultsView.element, 'find-and-replace:open-in-new-tab');
await paneItemOpening();
const postEditors = atom.workspace.getTextEditors(); // editors after command execution
const found = _.find(postEditors, (editor) => {
@@ -515,25 +515,14 @@ describe('ResultsView', () => {
expect(postEditors.length).toBe(preEditors.length + 1);
});
- it("brings an already opened tab into focus on 'find-and-replace:open-in-tab'", async () => {
- atom.commands.dispatch(resultsView.element, 'find-and-replace:open-in-tab');
+ it("brings an already opened tab into focus on 'find-and-replace:open-in-new-tab'", async () => {
+ atom.commands.dispatch(resultsView.element, 'find-and-replace:open-in-new-tab');
await paneItemOpening();
- atom.commands.dispatch(resultsView.element, 'find-and-replace:open-in-tab');
+ atom.commands.dispatch(resultsView.element, 'find-and-replace:open-in-new-tab');
await paneItemOpening();
expect(atom.workspace.getCenter().getActivePaneItem().getPath()).toContain('sample.');
})
- it("opens the file in a new window on 'find-and-replace:open-in-window'", async () => {
- spyOn(atom, 'open');
- atom.commands.dispatch(resultsView.element, 'find-and-replace:open-in-window');
- expect(atom.open).toHaveBeenCalledWith({
- pathsToOpen: [resultsView.model.getPaths()[0]],
- newWindow: true,
- devMode: atom.inDevMode(),
- safeMode: atom.inSafeMode()
- });
- });
-
describe("the `projectSearchResultsPaneSplitDirection` option", () => {
beforeEach(() => {
spyOn(atom.workspace, 'open').andCallThrough()

Renamed 'open-in-new-tab' command to 'open-in-new-tab', and removed 'open-in-window' command as well as its corresponding test.