       expect(TextManipulation.findMatchingClosingBracket bufferText, [], 0, false)
        .toEqual(null)
 
+    #                 01234567890123
+    nestedListText = '[xxx[xxx]xxx]'
+    it 'handles ignoredRange following nested list', ->
+      expect(TextManipulation.findMatchingClosingBracket nestedListText, [[9, 11]], 2, false)
+       .toEqual({bracketIx: 12, ranges: [ [2, 4], [11, 12] ]})
+    it 'handles ignoredRange immediately following nested list', ->
+      expect(TextManipulation.findMatchingClosingBracket nestedListText, [[10, 11]], 2, false)
+       .toEqual({bracketIx: 12, ranges: [ [2, 4], [9, 10], [11, 12] ]})
+    it 'handles ignoredRange spanning end of nested list', ->
+      expect(TextManipulation.findMatchingClosingBracket nestedListText, [[8, 11]], 2, false)
+       .toEqual(null)
+    it 'handles ignoredRange preceding nested list', ->
+      expect(TextManipulation.findMatchingClosingBracket nestedListText, [[2, 4]], 2, false)
+       .toEqual({bracketIx: 12, ranges: [ [9, 12] ]})
+    it 'handles ignoredRange immediately preceding nested list', ->
+      expect(TextManipulation.findMatchingClosingBracket nestedListText, [[2, 3]], 2, false)
+       .toEqual({bracketIx: 12, ranges: [ [3, 4], [9, 12] ]})
+    it 'handles index inside ignoredRange', ->
+      expect(TextManipulation.findMatchingClosingBracket nestedListText, [[2, 10]], 3, false)
+       .toEqual({bracketIx: 12, ranges: [ [10, 12] ]})
+
   describe 'getEnclosingList', ->
     #             01234567890123
     bufferText = '[1,(a,b),2]'

      .toBe('')

  describe 'findMatchingOpeningBracket', ->
    #             012345678901
    bufferText = '[1,[1,2,[]]]'
    it 'handles index at end of nested list', ->
      expect(TextManipulation.findMatchingOpeningBracket bufferText, [], 11, false)

        .toEqual(7)
    it 'handles index immediately after ignore', ->
      expect(TextManipulation.backwardSkipIgnored ignoreRanges, 6)
        .toEqual(4)
    it 'handles index inside ignore', ->
      expect(TextManipulation.backwardSkipIgnored ignoreRanges, 5)
        .toEqual(4)
