Skip to content

Commit

Permalink
Merge pull request #386 from mrodalgaard/standalone-editor
Browse files Browse the repository at this point in the history
Use provided editor in standAloneMinimapForEditor
  • Loading branch information
abe33 committed Sep 24, 2015
2 parents 023c2a3 + d33a26a commit f37fe1b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class Main

Minimap ?= require './minimap'
new Minimap({
textEditor: atom.workspace.getActiveTextEditor()
textEditor: textEditor
standAlone: true
})

Expand Down
7 changes: 6 additions & 1 deletion spec/minimap-main-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe 'Minimap package', ->
it 'destroys all the minimap elements', ->
expect(editorElement.shadowRoot.querySelector('atom-text-editor-minimap')).not.toExist()

## ######## ## ## ## ###### #### ## ## ######
## ######## ## ## ## ###### #### ## ## ######
## ## ## ## ## ## ## ## ## ### ## ## ##
## ## ## ## ## ## ## ## #### ## ##
## ######## ## ## ## ## #### ## ## ## ## ######
Expand All @@ -75,6 +75,11 @@ describe 'Minimap package', ->
it 'returns the minimap main module', ->
expect(minimapPackage.provideMinimapServiceV1()).toEqual(minimapPackage)

it 'creates standalone minimap with provided text editor', ->
textEditor = new TextEditor({})
standaloneMinimap = minimapPackage.standAloneMinimapForEditor(textEditor)
expect(standaloneMinimap.getTextEditor()).toEqual(textEditor)

describe 'plugins', ->
[registerHandler, unregisterHandler, plugin] = []

Expand Down

0 comments on commit f37fe1b

Please sign in to comment.