 BottomPanel = require('./views/bottom-panel')
 BottomContainer = require('./views/bottom-container')
 BottomStatus = require('./views/bottom-status')
+Message = require('./views/message')
 
 class LinterViews
   constructor: (@linter) ->
     @state = @linter.state
     @subscriptions = new CompositeDisposable
     @messages = []
-    @lineMessages = []
+    @messagesLine = []
     @markers = []
     @panel = new BottomPanel().prepare()
     @bottomContainer = new BottomContainer().prepare(@linter.state)
     @bottomBar = null
+    @bubble = null
 
     @subscriptions.add atom.config.observe('linter.underlineIssues', (underlineIssues) =>
       @underlineIssues = underlineIssues
+    )
+    @subscriptions.add atom.config.observe('linter.showErrorInline', (showBubble) =>
+      @showBubble = showBubble
     )
     @subscriptions.add atom.config.observe('linter.showErrorPanel', (showPanel) =>
       @panel.panelVisibility = showPanel

    @updateLineMessages()
    @renderPanelMessages()
    @renderPanelMarkers()

  renderCount: ->
    count = @linter.messages.getCount()
    count.Line = @lineMessages.length
    @bottomContainer.setCount(count)

  renderPanelMessages: ->

    @markers.forEach (marker) -> try marker.destroy()
    @markers = []

  removeBubble: ->
    @bubble?.destroy()
    @bubble = null

  destroy: ->
    @removeMarkers()
    @removeBubble()
    @subscriptions.dispose()
    @bottomBar.destroy()
    @panel.destroy()
