Skip to content

Commit

Permalink
Search all panes when opening a file
Browse files Browse the repository at this point in the history
Utilizes the `searchAllPanes` option when opening a file, which will
focus the editor if the test or module file is already open on another tab.

Docs: https://atom.io/docs/api/v1.39.0/Workspace#instance-open
  • Loading branch information
yurikoval committed Jul 24, 2019
1 parent 6848cdd commit ed1500d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/elixir-jump-around.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ export default {

toggle_test_file() {
currentFilePath = atom.workspace.getActiveTextEditor().getPath();
opts = {searchAllPanes: true}
if (this.isTestFilePath(currentFilePath)) {
return atom.workspace.open(this.getModulePath(currentFilePath));
return atom.workspace.open(this.getModulePath(currentFilePath), opts);
} else {
return atom.workspace.open(this.getTestPath(currentFilePath));
return atom.workspace.open(this.getTestPath(currentFilePath), opts);
}
},

Expand Down

0 comments on commit ed1500d

Please sign in to comment.