Skip to content

Commit

Permalink
fix: add deprecation warning for LegacyAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Dec 29, 2020
1 parent 6ff2dda commit cea6197
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/minimap.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import DecorationManagement from './mixins/decoration-management'

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

let nextModelId = 1

Expand Down Expand Up @@ -209,6 +208,9 @@ export default class Minimap {
if (atom.views.getView(this.textEditor).getScrollTop != null) {
this.adapter = new StableAdapter(this.textEditor)
} else {
// TODO remove LegacyAdapter in the next major version
atom.notifications.addWarning("LegacyAdapter of Minimap is deprecated and will be removed in the next major version. Please upgrade Atom to the latest version.")
const LegacyAdapter = require('./adapters/legacy-adapter')
this.adapter = new LegacyAdapter(this.textEditor)
}

Expand Down

0 comments on commit cea6197

Please sign in to comment.