               cutIxRange = [ listElements[0].start, listElements[cutEnd].eltStart ]
               newWhitespace = listElements[0].leadingWhitespace  # newElts[0].pre = cutElts[0].pre
             else # listElements[cutStart-1] exists
-              if cutEnd < listElements.length
+              if cutEnd == listElements.length # last element, so cut including remaining elt's trailing whitespace and replace that by closing bracket whitespace
+                cutIxRange = [ listElements[cutStart-1].eltEnd, listElements[cutEnd-1].end]
+                newWhitespace = listElements[cutEnd-1].trailingWhitespace   #newlistElements[n-1].post = cutElts[m].post
+              else # neither first nor last element are cut
                 cutIxRange = [ listElements[cutStart-1].end, listElements[cutEnd-1].end] # remove from preceding separator until post whitespace of last cut elt
                 newWhitespace = ''
-              else
-                cutIxRange = [ listElements[cutStart-1].eltEnd, listElements[cutEnd-1].end]
-                newWhitespace = listElements[cutEnd-1].trailingWhitespace   #newlistElements[n-1].post = cutElts[m].post
           console.log 'cut index range:' + cutIxRange
           console.log 'inserted: "' + newWhitespace + '"'
           cutRange = TextManipulation.getRangeForIxRange textBuffer, cutIxRange

          console.log newLength

          # TODO: rewrite in terms of trailing opening bracket whitespace, leading closing whitespace, etc.
          if newLength == 0
            cutIxRange = [listElements[cutStart].start, listElements[cutEnd-1].end]
            newWhitespace = ''
          else

      else
        console.log 'List elements'
        console.log e.show() for e in listElements
        console.log "Selection: [#{selStart},#{selEnd}>"
        if selStart == selEnd
          atom.notifications.addWarning 'Empty list selection.'
          # TODO: on empty, expand selection?
