mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Get spell check specs passing with new marker api
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user