       expect(editor.getSelectedBufferRanges()).toEqual [[[3, 5], [3, 5]], [[9, 0], [14, 0]]]
 
       # folds are also duplicated
-      expect(editor.tokenizedLineForScreenRow(5).fold).toBeDefined()
-      expect(editor.tokenizedLineForScreenRow(7).fold).toBeDefined()
-      expect(editor.tokenizedLineForScreenRow(7).text).toBe "    while(items.length > 0) {"
-      expect(editor.tokenizedLineForScreenRow(8).text).toBe "    return sort(left).concat(pivot).concat(sort(right));"
+      expect(editor.isFoldedAtScreenRow(5)).toBe(true)
+      expect(editor.isFoldedAtScreenRow(7)).toBe(true)
+      expect(editor.lineTextForScreenRow(7)).toBe "    while(items.length > 0) {⋯"
+      expect(editor.lineTextForScreenRow(8)).toBe "    return sort(left).concat(pivot).concat(sort(right));"
 
     it "duplicates all folded lines for empty selections on folded lines", ->
       editor.foldBufferRow(4)

          runs ->
            editor.setText("// SELECT * FROM OCTOCATS")

            {tokens} = editor.screenLineForScreenRow(0)
            expect(tokens[2].closeTags).toEqual ['comment.line.double-slash.js', 'source.js']
            expect(tokens[2].openTags).toEqual []
            expect(tokens[2].text).toBe ""

          waitsForPromise ->
            atom.packages.activatePackage('package-with-injection-selector')

          runs ->
            {tokens} = editor.screenLineForScreenRow(0)
            expect(tokens[2].closeTags).toEqual ['comment.line.double-slash.js', 'source.js']
            expect(tokens[2].openTags).toEqual []
            expect(tokens[2].text).toBe ""

          waitsForPromise ->
            atom.packages.activatePackage('language-sql')

          runs ->
            {tokens} = editor.screenLineForScreenRow(2)
            expect(tokens[2].closeTags).toEqual []
            expect(tokens[2].openTags).toEqual ["keyword.other.DML.sql"]
            expect(tokens[2].text).toBe "SELECT"

  describe ".normalizeTabsInBufferRange()", ->
    it "normalizes tabs depending on the editor's soft tab/tab length settings", ->

        runs ->
          editor.setText("// http://github.com")

          tokens = editor.tokensForScreenRow(0)
          expect(tokens).toEqual ['source.js', 'comment.line.double-slash.js', 'punctuation.definition.comment.js']

        waitsForPromise ->
          atom.packages.activatePackage('language-hyperlink')

        runs ->
          tokens = editor.tokensForScreenRow(0)
          expect(tokens).toEqual ['source.js', 'comment.line.double-slash.js', 'punctuation.definition.comment.js', 'markup.underline.link.http.hyperlink']

      describe "when the grammar is updated", ->
        it "retokenizes existing buffers that contain tokens that match the injection selector", ->
