       output = @createOutputPanel()
 
       if data
+        # show output of pawncc
         lines = data.split('\n')
         for line in lines
           output.add new PlainMessageView
             message: line
       else
+        # show error message if pawncc returned no output (unknown error)
         output.add new PlainMessageView
           message: 'Could not run pawncc: Unknown error (' + exitCode + ')'

    return @messages

  build: ->
    filepath = atom.workspace.getActiveTextEditor()?.getPath()

    # ignore command if current file is not saved, or is not a .pwn file
    return unless filepath? and path.extname(filepath) == '.pwn'

    # prepare command
    cmd = atom.config.get('pawn-build.pawnExecutablePath')

    # prepare arguments
    args = atom.config.get('pawn-build.pawnOptions')
    args.push path.basename filepath

    # run pawn
    process = child_process.spawn cmd, args,
      cwd: path.dirname filepath

    procout = []
    hasError = false

    process.stdout.on 'data', (data) ->
      procout.push data.toString()

    process.stderr.on 'data', (data) ->
      procout.push data.toString()

    process.on 'error', (error) =>
      hasError = true
      output = @createOutputPanel()
      output.add new PlainMessageView

  serialize: -> undefined

  createOutputPanel: ->
    # Create output panel (or return if already exists)
    unless @messages?
      @messages = new MessagePanelView
        title: 'Pawn output'
