Skip to content

Commit

Permalink
fix: delete the editor from editorsMinimaps if destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jan 17, 2021
1 parent aa48eba commit defc58c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ let toggled = false
* @type {Map}
* @access private
*/
let editorsMinimaps = null
export let editorsMinimaps = null
/**
* The composite disposable that stores the package's subscriptions.
*
Expand Down
6 changes: 5 additions & 1 deletion lib/minimap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { Emitter, CompositeDisposable } from 'atom'
import StableAdapter from './adapters/stable-adapter'
import { editorsMinimaps } from './main'

let nextModelId = 1

Expand Down Expand Up @@ -268,7 +269,10 @@ export default class Minimap {
this.scheduleChanges(changes)
}),

this.textEditor.onDidDestroy(() => { this.destroy() }),
this.textEditor.onDidDestroy(() => {
editorsMinimaps.delete(this.textEditor)
this.destroy()
}),

/*
FIXME Some changes occuring during the tokenization produces
Expand Down

0 comments on commit defc58c

Please sign in to comment.