Skip to content

Commit

Permalink
Split out the monster HighlightedAreaView file
Browse files Browse the repository at this point in the history
  • Loading branch information
richrace committed Mar 17, 2019
1 parent c01e77c commit e796c65
Show file tree
Hide file tree
Showing 8 changed files with 242 additions and 199 deletions.
17 changes: 13 additions & 4 deletions lib/highlight-selected.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { CompositeDisposable } = require('atom');
const HighlightedAreaView = require('./highlighted-area-view');
const ScrollMarkersService = require('./scroll-markers/scroll-markers-service');
const StatusBarService = require('./status-bar/status-bar-service');

module.exports = {
config: {
Expand Down Expand Up @@ -79,14 +81,21 @@ module.exports = {
},

deactivate() {
if (this.areaView != null) {
if (this.areaView) {
this.areaView.destroy();
}
this.areaView = null;
if (this.subscriptions != null) {
if (this.subscriptions) {
this.subscriptions.dispose();
}
this.subscriptions = null;
if (this.scrollMarkersService) {
this.scrollMarkersService.destroy();
}
this.scrollMarkersService = null;
if (this.statusBarService) {
this.statusBarService = null;
}
},

provideHighlightSelectedV1Deprecated() {
Expand All @@ -98,7 +107,7 @@ module.exports = {
},

consumeStatusBar(statusBar) {
return this.areaView.setStatusBar(statusBar);
this.statusBarService = new StatusBarService(statusBar, this.areaView);
},

toggle() {
Expand All @@ -113,6 +122,6 @@ module.exports = {
},

consumeScrollMarker(scrollMarkerAPI) {
return this.areaView.setScrollMarker(scrollMarkerAPI);
this.scrollMarkersService = new ScrollMarkersService(this.areaView, scrollMarkerAPI);
}
};
Loading

0 comments on commit e796c65

Please sign in to comment.