     @subscribeToCommand editorView, 'mark:goto-mark', => @gotoMark()
     @subscribeToCommand editorView, 'mark:swap', => @swapWithMark()
 
-  updateGutter: ->
-    if @marker?
-      @gutter.addClassToLine(@marker.getHeadBufferPosition().row, 'marked')
+  createMark: (point) ->
+    marker = @editor.markBufferPosition(point)
+    @decoration = @editor.decorateMarker(marker, { type: 'gutter', class: 'marked' })
 
-  createMark: (point) ->
-    @marker = @editor.markBufferPosition(point)
-    @gutter.addClassToLine(point.row, 'marked')
-
-    @subscribe @marker, 'changed', ({ isValid }) =>
+    @subscribe marker, 'changed', ({ isValid }) =>
       if not isValid
-        @unsubscribe(@marker)
-        @marker.destroy()
-        @marker = undefined
+        @unsubscribe(@decoration.getMarker())
+        @decoration.getMarker().destroy()
+        @decoration = undefined
 
   clearMark: () ->
-    if @marker
-      @gutter.removeClassFromLine(@marker.getHeadBufferPosition().row, 'marked')
-      @marker.destroy()
-      @marker = undefined
+    if @decoration
+      @decoration.getMarker().destroy()
+      @decoration = undefined
 
   toggle: ->
     if not @gutter.isVisible
       return
 
-    markPoint = @marker?.getHeadBufferPosition()
+    markPoint   = @decoration?.getMarker().getHeadBufferPosition()
     cursorPoint = @editor.getCursorBufferPosition()
 
     if markPoint?

  constructor: (editorView) ->
    {@editor, @gutter} = editorView

    @marker = undefined

    @subscribe editorView, 'editor:display-updated', => @updateGutter()
    @subscribe @editor, 'destroyed', => @unsubscribe()
    @subscribeToCommand editorView, 'mark:toggle', => @toggle()
    @subscribeToCommand editorView, 'mark:clear-mark', => @clearMark()

      @createMark(cursorPoint)

  selectToMark: ->
    if @decoration
      markPoint   = @decoration?.getMarker().getHeadBufferPosition()
      cursorPoint = @editor.getCursorBufferPosition()
      if not cursorPoint.isEqual(markPoint)
        @editor.setSelectedBufferRange([markPoint, cursorPoint])

  gotoMark: ->
    if @decoration
      @editor.setCursorBufferPosition(@decoration.getMarker().getHeadBufferPosition())

  swapWithMark: ->
    if @decoration
      cursorPoint = @editor.getCursorBufferPosition()
      markPoint   = @decoration.getMarker().getHeadBufferPosition()
      if not cursorPoint.isEqual(markPoint)
        @decoration.getMarker().setHeadBufferPosition(cursorPoint)
        @editor.setCursorBufferPosition(markPoint)
