Get spell check specs passing with new marker api

This commit is contained in:
Nathan Sobo
2013-04-29 10:47:03 -06:00
parent 8c037bf425
commit b35bd36ec7
2 changed files with 4 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ class MisspellingView extends View
@misspellingValid = true
@marker = @editSession.markScreenRange(range, invalidationStrategy: 'between')
@editSession.observeMarker @marker, ({newHeadScreenPosition, newTailScreenPosition, valid}) =>
@marker.observe ({newHeadScreenPosition, newTailScreenPosition, valid}) =>
@startPosition = newTailScreenPosition
@endPosition = newHeadScreenPosition
@updateDisplayPosition = valid
@@ -42,8 +42,7 @@ class MisspellingView extends View
unsubscribe: ->
super
@editSession.destroyMarker(@marker)
@marker.destroy()
containsCursor: ->
cursor = @editor.getCursorScreenPosition()

View File

@@ -111,6 +111,6 @@ describe "Spell check", ->
expect(editor.find('.misspelling').length).toBe 1
view = editor.find('.misspelling').view()
buffer = editor.getBuffer()
expect(buffer.getMarkerPosition(view.marker)).not.toBeUndefined()
expect(view.marker.isDestroyed()).toBeFalsy()
editor.remove()
expect(buffer.getMarkerPosition(view.marker)).toBeUndefined()
expect(view.marker.isDestroyed()).toBeTruthy()