           returnedCursorPos = @getReturnedCursorPosition(stdout)
           convertedCursorPos = @convertReturnedCursorPosition(editor, returnedCursorPos)
           editor.setCursorBufferPosition(convertedCursorPos)
+
+      child.stdin.write(editor.getText())
+      child.stdin.end()
 
   getEndJSONPosition: (text) ->
     for i in [0..(text.length-1)]

    text = editor.getTextInBufferRange([[0, 0], cursorPosition])
    return text.length

  convertReturnedCursorPosition: (editor, position) ->
    text = editor.getText()
    x = y = 0

      style = atom.config.get('clang-format.style')
      path = editor.getPath()
      cursor = @getCurrentCursorPosition(editor)
      command = exe + ' -cursor=' + cursor.toString() +
                ' -style=' + style +
                ' -lines=' + @getTargetLineNums(editor)

      child = exec command, (err, stdout, stderr) =>
        if err
          console.log(err)
          console.log(stdout)
