@@ -2,39 +2,35 @@ const { CompositeDisposable } = require('atom')
22
33let MinimapGitDiffBinding = null
44
5- class MinimapGitDiff {
6- constructor ( ) {
7- this . pluginActive = false
8- this . createBindings = this . createBindings . bind ( this )
9- this . destroyBindings = this . destroyBindings . bind ( this )
10- this . subscriptions = new CompositeDisposable ( )
11- }
12-
13- get config ( ) {
14- return {
15- useGutterDecoration : {
16- type : 'boolean' ,
17- default : false ,
18- description : 'When enabled the git diffs will be displayed as thin vertical lines on the left side of the minimap.' ,
19- } ,
20- }
21- }
22-
23- isActive ( ) { return this . pluginActive }
5+ module . exports = {
6+ config : {
7+ useGutterDecoration : {
8+ type : 'boolean' ,
9+ default : false ,
10+ description : 'When enabled the git diffs will be displayed as thin vertical lines on the left side of the minimap.' ,
11+ } ,
12+ } ,
13+
14+ isActive ( ) {
15+ return this . pluginActive
16+ } ,
2417
2518 activate ( ) {
19+ this . pluginActive = false
20+ this . subscriptions = new CompositeDisposable ( )
2621 this . bindings = new WeakMap ( )
27- }
22+ require ( 'atom-package-deps' ) . install ( 'minimap-git-diff' )
23+ } ,
2824
2925 consumeMinimapServiceV1 ( minimap ) {
3026 this . minimap = minimap
3127 return this . minimap . registerPlugin ( 'git-diff' , this )
32- }
28+ } ,
3329
3430 deactivate ( ) {
3531 this . destroyBindings ( )
3632 this . minimap = null
37- }
33+ } ,
3834
3935 activatePlugin ( ) {
4036 if ( this . pluginActive ) { return }
@@ -43,20 +39,20 @@ class MinimapGitDiff {
4339 this . createBindings ( )
4440 this . pluginActive = true
4541
46- this . subscriptions . add ( this . minimap . onDidActivate ( this . createBindings ) )
47- this . subscriptions . add ( this . minimap . onDidDeactivate ( this . destroyBindings ) )
42+ this . subscriptions . add ( this . minimap . onDidActivate ( this . createBindings . bind ( this ) ) )
43+ this . subscriptions . add ( this . minimap . onDidDeactivate ( this . destroyBindings . bind ( this ) ) )
4844 } catch ( e ) {
4945 console . log ( e )
5046 }
51- }
47+ } ,
5248
5349 deactivatePlugin ( ) {
5450 if ( ! this . pluginActive ) { return }
5551
5652 this . pluginActive = false
5753 this . subscriptions . dispose ( )
5854 this . destroyBindings ( )
59- }
55+ } ,
6056
6157 createBindings ( ) {
6258 if ( ! MinimapGitDiffBinding ) { MinimapGitDiffBinding = require ( './minimap-git-diff-binding' ) }
@@ -71,7 +67,7 @@ class MinimapGitDiff {
7167 this . bindings . set ( minimap , binding )
7268 } ) ,
7369 )
74- }
70+ } ,
7571
7672 destroyBindings ( ) {
7773 if ( ! this . minimap || ! this . minimap . editorsMinimaps ) { return }
@@ -82,7 +78,5 @@ class MinimapGitDiff {
8278 }
8379 this . bindings . delete ( minimap )
8480 } )
85- }
81+ } ,
8682}
87-
88- module . exports = new MinimapGitDiff ( )
0 commit comments