@@ -3,48 +3,48 @@ const GitHubFile = require('./github-file')
3
3
4
4
function getActivePath ( target ) {
5
5
if ( ! target ) {
6
- return atom . project . getPaths ( ) [ 0 ] ;
6
+ return atom . project . getPaths ( ) [ 0 ]
7
7
}
8
8
9
- const treeView = target . closest ( " .tree-view" ) ;
9
+ const treeView = target . closest ( ' .tree-view' )
10
10
if ( treeView ) {
11
11
// called from treeview
12
- const selected = treeView . querySelector ( " .selected > .list-item > .name, .selected > .name" ) ;
12
+ const selected = treeView . querySelector ( ' .selected > .list-item > .name, .selected > .name' )
13
13
if ( selected ) {
14
- return selected . dataset . path ;
14
+ return selected . dataset . path
15
15
}
16
- return ;
16
+ return
17
17
}
18
18
19
- const tab = target . closest ( " .tab-bar > .tab" ) ;
19
+ const tab = target . closest ( ' .tab-bar > .tab' )
20
20
if ( tab ) {
21
21
// called from tab
22
- const title = tab . querySelector ( " .title" ) ;
22
+ const title = tab . querySelector ( ' .title' )
23
23
if ( title && title . dataset . path ) {
24
- return title . dataset . path ;
24
+ return title . dataset . path
25
25
}
26
- return ;
26
+ return
27
27
}
28
28
29
- const paneItem = atom . workspace . getActivePaneItem ( ) ;
30
- if ( paneItem && typeof paneItem . getPath === " function" ) {
29
+ const paneItem = atom . workspace . getActivePaneItem ( )
30
+ if ( paneItem && typeof paneItem . getPath === ' function' ) {
31
31
// called from active pane
32
- return paneItem . getPath ( ) ;
32
+ return paneItem . getPath ( )
33
33
}
34
34
35
- const textEditor = atom . workspace . getActiveTextEditor ( ) ;
36
- if ( textEditor && typeof textEditor . getPath === " function" ) {
35
+ const textEditor = atom . workspace . getActiveTextEditor ( )
36
+ if ( textEditor && typeof textEditor . getPath === ' function' ) {
37
37
// fallback to activeTextEditor if activePaneItem is not a file
38
- return textEditor . getPath ( ) ;
38
+ return textEditor . getPath ( )
39
39
}
40
40
}
41
41
42
- function pathCommand ( func ) {
42
+ function pathCommand ( func ) {
43
43
return function ( e ) {
44
44
const itemPath = getActivePath ( e . target )
45
45
46
46
if ( itemPath ) {
47
- func ( itemPath ) ;
47
+ func ( itemPath )
48
48
}
49
49
}
50
50
}
0 commit comments