             editor.pasteText()
             expect(editor.lineTextForBufferRow(5)).toBe("console.log(x);")
             expect(editor.lineTextForBufferRow(6)).toBe("console.log(y);")
+
+          it "does not normalize the indentation level of the text", ->
+            copyText("   function() {\nvar cool = 1;\n  }\n")
+            editor.setCursorBufferPosition([5, 2])
+            editor.pasteText()
+            expect(editor.lineTextForBufferRow(5)).toBe "     function() {"
+            expect(editor.lineTextForBufferRow(6)).toBe "var cool = 1;"
+            expect(editor.lineTextForBufferRow(7)).toBe "  }"
 
         describe 'when the clipboard has many selections', ->
           it "pastes each selection separately into the buffer", ->

        expect(editor.tokenizedLineForScreenRow(0).tokens.length).toBeGreaterThan 1

  describe "auto-indent", ->
    copyText = (text, {startColumn, textEditor}={}) ->
      startColumn ?= 0
      textEditor ?= editor
      textEditor.setCursorBufferPosition([0, 0])
      textEditor.insertText(text)
      numberOfNewlines = text.match(/\n/g)?.length
      endColumn = text.match(/[^\n]*$/)[0]?.length
      textEditor.getLastSelection().setBufferRange([[0,startColumn], [numberOfNewlines,endColumn]])
      textEditor.cutSelectedText()

    describe "editor.autoIndent", ->
      describe "when editor.autoIndent is false (default)", ->
        describe "when `indent` is triggered", ->

            ])

      describe ".pasteText()", ->
        copyText = (text, {startColumn, textEditor}={}) ->
          startColumn ?= 0
          textEditor ?= editor
          textEditor.setCursorBufferPosition([0, 0])
          textEditor.insertText(text)
          numberOfNewlines = text.match(/\n/g)?.length
          endColumn = text.match(/[^\n]*$/)[0]?.length
          textEditor.getLastSelection().setBufferRange([[0,startColumn], [numberOfNewlines,endColumn]])
          textEditor.cutSelectedText()

        it "pastes text into the buffer", ->
          atom.clipboard.write('first')
          editor.pasteText()
          expect(editor.lineTextForBufferRow(0)).toBe "var first = function () {"
          expect(editor.lineTextForBufferRow(1)).toBe "  var first = function(items) {"

        describe "when `autoIndentOnPaste` is true", ->
          beforeEach ->
            atom.config.set("editor.autoIndentOnPaste", true)

