       position = cursor.getBufferPosition()
       bookmarks = @findBookmarkMarkers(startBufferRow: position.row)
 
-      if bookmarks and bookmarks.length
+      if bookmarks?.length > 0
         bookmark.destroy() for bookmark in bookmarks
+        @editor.getBuffer().emit 'bookmarks:destroyed'
       else
         newmark = @createBookmarkMarker(position.row)
 

    {@editor, @gutter} = editorView

    editorView.on 'editor:display-updated', @renderBookmarkMarkers

    editorView.command 'bookmarks:toggle-bookmark', @toggleBookmark
    editorView.command 'bookmarks:jump-to-next-bookmark', @jumpToNextBookmark

    bookmark = @displayBuffer().markBufferRange(range, @bookmarkMarkerAttributes(invalidate: 'surround'))
    bookmark.on 'changed', ({isValid}) ->
      bookmark.destroy() unless isValid
    @editor.getBuffer().emit 'bookmarks:created'
    bookmark

  findBookmarkMarkers: (attributes={}) ->
    @displayBuffer().findMarkers(@bookmarkMarkerAttributes(attributes))

  bookmarkMarkerAttributes: (attributes={}) ->
    _.extend(attributes, class: 'bookmark')

  displayBuffer: ->
    @editor.displayBuffer
