     @toolBar.toolBarView || @toolBar.toolBar
 
   reloadToolbar: (withNotification=false) ->
+    console.log 'reloading tooblar'
     return unless @toolBar?
     try
       @fixToolBarHeight()


    return config

  condition: (conditions) ->
    conditions = [conditions] if not Array.isArray conditions
    filePath = atom.workspace.getActivePaneItem()?.getPath?()

    for condition in conditions

      if typeof condition is 'string'
        reverse = false
        if /^!/.test condition
          condition = condition.replace '!', ''
          reverse = true

        if /^[^\/]+\.(.*?)$/.test condition
          result = true if filePath isnt undefined and filePath.match(condition)?.length > 0
        else
          result = true if @currentGrammar? and @currentGrammar.includes condition.toLowerCase()

        result = !result if reverse
        return true if result

      else if typeof condition is 'function'
        return true if condition()

      else

        if condition.pattern?
          if filePath isnt undefined
            result = globToRegexp(condition.pattern, extended: true).test filePath

          return true if result is true

        if condition.package?
          pkg = condition.package
          reverse = false
          if /^!/.test pkg
            pkg = pkg.replace '!', ''
            reverse = true

          result = true if atom.packages.isPackageLoaded(pkg) and not atom.packages.isPackageDisabled(pkg)
          result = !result if reverse
          return true if result


    return false

  storeProject: ->
    editor = atom.workspace.getActivePaneItem()

    @storeGrammar()
    @registerTypes()
    @registerCommand()
    @registerEvents()
    @registerWatch()
    @registerProjectWatch()

