         
         let newStrings = [String](repeating: "", count: deletionRanges.count)
         let selectedRanges = (self.rangesForUserTextChange ?? self.selectedRanges)
-            .map { $0.rangeValue.move(deleting: deletionRanges) }
+            .map { $0.rangeValue.deleted(ranges: deletionRanges) }
         
         self.replace(with: newStrings, ranges: deletionRanges, selectedRanges: selectedRanges,
                      actionName: "Uncomment".localized)

        let newStrings = items.map { $0.string }
        let replacementRanges = items.map { NSRange($0.location..<$0.location) }
        let selectedRanges = (self.rangesForUserTextChange ?? self.selectedRanges)
            .map { $0.rangeValue.move(inserting: items) }
        
        self.replace(with: newStrings, ranges: replacementRanges, selectedRanges: selectedRanges,
                     actionName: "Comment Out".localized)

        
        let spacer = self.appendsCommentSpacer ? " " : ""
        let targetRanges = self.commentingRanges(fromLineHead: fromLineHead)
        let items: [NSRange.InsertionItem] = {
            if let delimiter = self.inlineCommentDelimiter, types.contains(.inline) {
                return self.string.inlineCommentOut(delimiter: delimiter, spacer: spacer, ranges: targetRanges)
            }
