diff --git a/src/packages/spell-check/lib/misspelling-view.coffee b/src/packages/spell-check/lib/misspelling-view.coffee index b2afdf1ce..05ce0a800 100644 --- a/src/packages/spell-check/lib/misspelling-view.coffee +++ b/src/packages/spell-check/lib/misspelling-view.coffee @@ -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() diff --git a/src/packages/spell-check/spec/spell-check-spec.coffee b/src/packages/spell-check/spec/spell-check-spec.coffee index 97fcc2bd9..2838909d8 100644 --- a/src/packages/spell-check/spec/spell-check-spec.coffee +++ b/src/packages/spell-check/spec/spell-check-spec.coffee @@ -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()