diff --git a/lib/minimap-element.js b/lib/minimap-element.js index 01358d0a..80feb23a 100644 --- a/lib/minimap-element.js +++ b/lib/minimap-element.js @@ -322,6 +322,10 @@ export default class MinimapElement { this.attached = true this.attachedToTextEditor = this.parentNode === this.getTextEditorElementRoot() + if (this.attachedToTextEditor) { + this.getTextEditorElement().setAttribute('with-minimap', '') + } + /* We use `atom.styles.onDidAddStyleElement` instead of `atom.themes.onDidChangeActiveThemes`. @@ -376,10 +380,6 @@ export default class MinimapElement { attach (parent) { if (this.attached) { return } (parent || this.getTextEditorElementRoot()).appendChild(this) - - if (!parent) { - this.getTextEditorElement().setAttribute('with-minimap', '') - } } /**