Skip to content

Commit 53c627f

Browse files
committed
fix: move this.displayCodeHighlights to CanvasDrawer
1 parent fad47be commit 53c627f

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

lib/minimap-element.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,7 @@ class MinimapElement {
137137
* @access private
138138
*/
139139
this.textOpacity = undefined
140-
/**
141-
* @access private
142-
*/
143-
this.displayCodeHighlights = undefined
140+
144141
/**
145142
* @access private
146143
*/
@@ -262,7 +259,7 @@ class MinimapElement {
262259
}),
263260

264261
atom.config.observe('minimap.displayCodeHighlights', (displayCodeHighlights) => {
265-
this.displayCodeHighlights = displayCodeHighlights
262+
this.CanvasDrawer.displayCodeHighlights = displayCodeHighlights
266263

267264
if (this.attached) { this.requestForcedUpdate() }
268265
}),
@@ -901,7 +898,7 @@ class MinimapElement {
901898
* highlights or not
902899
*/
903900
setDisplayCodeHighlights (displayCodeHighlights) {
904-
this.displayCodeHighlights = displayCodeHighlights
901+
this.CanvasDrawer.displayCodeHighlights = displayCodeHighlights
905902
if (this.attached) { this.requestForcedUpdate() }
906903
}
907904

lib/mixins/canvas-drawer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export default class CanvasDrawer {
1717
constructor () {
1818
// set in setModel of minimapElement
1919
this.minimap = undefined
20+
// set by minimapElement
21+
this.displayCodeHighlights = undefined
2022

2123
/**
2224
* This MinimapElement's DOMStylesReader

spec/minimap-element-spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,7 +1828,7 @@ describe('MinimapElement', () => {
18281828
})
18291829

18301830
it('toggles the code highlights on the minimap element', () => {
1831-
expect(minimapElement.displayCodeHighlights).toBeTruthy()
1831+
expect(minimapElement.CanvasDrawer.displayCodeHighlights).toBeTruthy()
18321832
})
18331833

18341834
it('requests an update', () => {
@@ -1997,14 +1997,14 @@ describe('MinimapElement', () => {
19971997
describe('on the code highlight item', () => {
19981998
let [initial] = []
19991999
beforeEach(() => {
2000-
initial = minimapElement.displayCodeHighlights
2000+
initial = minimapElement.CanvasDrawer.displayCodeHighlights
20012001
atom.commands.dispatch(quickSettingsElement, 'core:move-down')
20022002
atom.commands.dispatch(quickSettingsElement, 'core:move-down')
20032003
atom.commands.dispatch(quickSettingsElement, 'core:confirm')
20042004
})
20052005

20062006
it('toggles the code highlights on the minimap element', () => {
2007-
expect(minimapElement.displayCodeHighlights).toEqual(!initial)
2007+
expect(minimapElement.CanvasDrawer.displayCodeHighlights).toEqual(!initial)
20082008
})
20092009
})
20102010

0 commit comments

Comments
 (0)