         line = lines[row]
 
       if tagName?
-        editor.insertText('</' + tagName + '>', {undo: 'skip'})
+        if atom.config.get('react.skipUndoStackForAutoCloseInsertion')
+          options = {undo: 'skip'}
+        else
+          options = {}
+        console.log options
+        editor.insertText('</' + tagName + '>', options)
         editor.setCursorBufferPosition(eventObj.newRange.end)
 
     else if eventObj?.oldText is '>' and eventObj?.newText is ''

        rest = fullLine.substr(eventObj.newRange.end.column)
        if rest.indexOf('</' + tagName + '>') == 0
          # rest is closing tag
          serializedEndPoint = [eventObj.newRange.end.row, eventObj.newRange.end.column];
          editor.setTextInBufferRange(
            [
              serializedEndPoint,
              [serializedEndPoint[0], serializedEndPoint[1] + tagName.length + 3]
            ]
          , '', {undo: 'skip'})

    else if eventObj? and eventObj.newText.match /\r?\n/
      lines = editor.buffer.getLines()

      type: 'boolean'
      default: false
      description: 'Disabled tag autocompletion'
    skipUndoStackForAutoCloseInsertion:
      type: 'boolean'
      default: true
      description: 'When enabled, auto insert/remove closing tag mutation is skipped from normal undo/redo operation'
    detectReactFilePattern:
      type: 'string'
      default: defaultDetectReactFilePattern
