Skip to content

Commit

Permalink
🐛 Fix access to private API removed in latest master
Browse files Browse the repository at this point in the history
Fixes #387
  • Loading branch information
abe33 committed Sep 28, 2015
1 parent 0d7f096 commit cf37f60
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/minimap.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Minimap
# :textEditor - A `TextEditor` instance.
constructor: (options={}) ->
{@textEditor, @standAlone, @width, @height} = options
@textEditorElement = atom.views.getView(@textEditor)
unless @textEditor?
throw new Error('Cannot create a minimap without an editor')

Expand Down Expand Up @@ -78,6 +79,7 @@ class Minimap
@subscriptions.dispose()
@subscriptions = null
@textEditor = null
@textEditorElement = null
@emitter.emit 'did-destroy'
@emitter.dispose()
@destroyed = true
Expand Down Expand Up @@ -197,8 +199,8 @@ class Minimap
#
# Returns a {Number}.
getTextEditorMaxScrollTop: ->
maxScrollTop = @textEditor.displayBuffer.getMaxScrollTop()
lineHeight = @textEditor.displayBuffer.getLineHeightInPixels()
maxScrollTop = @textEditorElement.getScrollHeight()
lineHeight = @textEditor.getLineHeightInPixels()

maxScrollTop -= @textEditor.getHeight() - 3 * lineHeight if @scrollPastEnd
maxScrollTop
Expand Down

0 comments on commit cf37f60

Please sign in to comment.