 {View} = require 'atom'
 
-# Status bar view for the soft wrap indicator.
+# Public: Status bar view for the soft wrap indicator.
 module.exports =
 class SoftWrapIndicatorView extends View
   @content: ->
     @div class: 'inline-block', =>
       @a 'Wrap', class: 'soft-wrap-indicator', outlet: 'light'
 
-  # Initializes the view by subscribing to various events.
+  # Public: Initializes the view by subscribing to various events.
   #
   # statusBar - {StatusBar} of the application
   initialize: (@statusBar) ->

    else
      @light.hide()

  # Tear down any state and detach.
  destroy: ->
    @remove()


    @subscribe this, 'click', => @getActiveEditor()?.toggleSoftWrap()

  # Internal: Executed by the framework after the view is added to the status bar.
  afterAttach: ->
    @update()

  # Internal: Gets the currently active `Editor`.
  #
  # Returns the {Editor} that is currently active or `null` if there is not one active.
  getActiveEditor: ->
    atom.workspace.getActiveEditor()

  # Internal: Updates the indicator based on the current state of the application.
  update: =>
    if @getActiveEditor()?.getSoftWrap()
      @light.addClass('lit').show()
