       @gutterBackgroundColor
     else
       @backgroundColor
+
+  didAddGutter: (gutter) ->
+    gutterDisposables = new CompositeDisposable
+    gutterDisposables.add gutter.onDidChangeVisible =>
+      @updateCustomGutterState()
+    gutterDisposables.add gutter.onDidDestroy =>
+      @disposables.remove(gutterDisposables)
+      gutterDisposables.dispose()
+      @updateCustomGutterState()
+    @disposables.add(gutterDisposables)
+    @updateCustomGutterState()
+
+  updateCustomGutterState: ->
+    @batch "shouldUpdateCustomGutterState", ->
+      @state.gutters.sortedDescriptions = []
+      if @model.isMini()
+        return
+      for gutter in @model.getGutters()
+        isVisible = gutter.isVisible()
+        if gutter.name is 'line-number'
+          isVisible = isVisible && @showLineNumbers
+        if isVisible
+          @state.gutters.sortedDescriptions.push({name: gutter.name})
 
   updateLineNumbersState: -> @batch "shouldUpdateLineNumbersState", ->
     return unless @startRow? and @endRow? and @lineHeight?

    @updateOverlaysState() if @shouldUpdateOverlaysState
    @updateLineNumberGutterState() if @shouldUpdateLineNumberGutterState
    @updateLineNumbersState() if @shouldUpdateLineNumbersState

    @updating = false

    @state

      @backgroundColor = backgroundColor
      @updateContentState()
      @updateLineNumberGutterState()
      @updateCustomGutterState()

  setGutterBackgroundColor: (gutterBackgroundColor) ->
    unless @gutterBackgroundColor is gutterBackgroundColor
      @gutterBackgroundColor = gutterBackgroundColor
      @updateLineNumberGutterState()
      @updateCustomGutterState()

  setLineHeight: (lineHeight) ->
    unless @lineHeight is lineHeight
