From b35bd36ec7572336214ee2c191858efe916e6255 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 29 Apr 2013 10:47:03 -0600 Subject: [PATCH] Get spell check specs passing with new marker api --- src/packages/spell-check/lib/misspelling-view.coffee | 5 ++--- src/packages/spell-check/spec/spell-check-spec.coffee | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) 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()