<p dir="auto">Uncaught TypeError: Cannot read property 'slice' of undefined</p>
<p dir="auto"><strong>Atom Version</strong>: 0.162.0<br>
<strong>System</strong>: linux 3.13.0-43-generic<br>
<strong>Thrown From</strong>: Atom Core</p>
<h3 dir="auto">Steps To Reproduce</h3>
<p dir="auto">I have undone some things (ctrl + z) and then redone (ctrl + shift + z).</p>
<h3 dir="auto">Stack Trace</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="At /usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:557

TypeError: Cannot read property 'slice' of undefined
  at TextBuffer.module.exports.TextBuffer.applyPatch (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:557:39)
  at BufferPatch.module.exports.BufferPatch.applyTo (/usr/share/atom/resources/app/node_modules/text-buffer/lib/buffer-patch.js:74:21)
  at Transaction.module.exports.Transaction.applyTo (/usr/share/atom/resources/app/node_modules/text-buffer/lib/transaction.js:60:29)
  at History.module.exports.History.undo (/usr/share/atom/resources/app/node_modules/text-buffer/lib/history.js:84:24)
  at TextBuffer.module.exports.TextBuffer.undo (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:675:27)
  at TextEditor.module.exports.TextEditor.undo (/usr/share/atom/resources/app/src/text-editor.js:1137:26)
  at TextEditor.atom.commands.add.stopEventPropagation.core:undo (/usr/share/atom/resources/app/src/text-editor-element.js:304:19)
  at atom-text-editor.newCommandListeners.(anonymous function) (/usr/share/atom/resources/app/src/text-editor-element.js:272:32)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:243:29)
  at /usr/share/atom/resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:549:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:391:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/usr/share/atom/resources/app/src/window-event-handler.js:167:20)
"><pre class="notranslate"><code class="notranslate">At /usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:557

TypeError: Cannot read property 'slice' of undefined
  at TextBuffer.module.exports.TextBuffer.applyPatch (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:557:39)
  at BufferPatch.module.exports.BufferPatch.applyTo (/usr/share/atom/resources/app/node_modules/text-buffer/lib/buffer-patch.js:74:21)
  at Transaction.module.exports.Transaction.applyTo (/usr/share/atom/resources/app/node_modules/text-buffer/lib/transaction.js:60:29)
  at History.module.exports.History.undo (/usr/share/atom/resources/app/node_modules/text-buffer/lib/history.js:84:24)
  at TextBuffer.module.exports.TextBuffer.undo (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:675:27)
  at TextEditor.module.exports.TextEditor.undo (/usr/share/atom/resources/app/src/text-editor.js:1137:26)
  at TextEditor.atom.commands.add.stopEventPropagation.core:undo (/usr/share/atom/resources/app/src/text-editor-element.js:304:19)
  at atom-text-editor.newCommandListeners.(anonymous function) (/usr/share/atom/resources/app/src/text-editor-element.js:272:32)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:243:29)
  at /usr/share/atom/resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:549:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:391:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/usr/share/atom/resources/app/src/window-event-handler.js:167:20)

</code></pre></div>
<h3 dir="auto">Steps To Reproduce:</h3>
<ul dir="auto">
<li>Create an __ init __.py in a python package</li>
<li>Try to add a few new lines by typing enter (I can't have more than two lines)</li>
</ul>
<h3 dir="auto">Error</h3>
<p dir="auto">Uncaught TypeError: Cannot read property  slice  of undefined <strong>Atom Version</strong>: 0.158.0 <strong>System</strong>: linux 3.13.0-43-generic <strong>Thrown From</strong>: Atom Core</p>
<h3 dir="auto">Stack Trace</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="At /usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:557

TypeError: Cannot read property 'slice' of undefined
  at TextBuffer.module.exports.TextBuffer.applyPatch (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:557:39)
  at BufferPatch.module.exports.BufferPatch.applyTo (/usr/share/atom/resources/app/node_modules/text-buffer/lib/buffer-patch.js:74:21)
  at Transaction.module.exports.Transaction.applyTo (/usr/share/atom/resources/app/node_modules/text-buffer/lib/transaction.js:60:29)
  at History.module.exports.History.abortTransaction (/usr/share/atom/resources/app/node_modules/text-buffer/lib/history.js:162:24)
  at History.module.exports.History.transact (/usr/share/atom/resources/app/node_modules/text-buffer/lib/history.js:119:16)
  at TextBuffer.module.exports.TextBuffer.transact (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:683:27)
  at TextEditor.module.exports.TextEditor.transact (/usr/share/atom/resources/app/src/text-editor.js:1146:26)
  at atom-text-editor.newCommandListeners.(anonymous function) (/usr/share/atom/resources/app/src/text-editor-element.js:290:22)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:243:29)
  at /usr/share/atom/resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:549:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:391:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/usr/share/atom/resources/app/src/window-event-handler.js:167:20)"><pre class="notranslate"><code class="notranslate">At /usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:557

TypeError: Cannot read property 'slice' of undefined
  at TextBuffer.module.exports.TextBuffer.applyPatch (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:557:39)
  at BufferPatch.module.exports.BufferPatch.applyTo (/usr/share/atom/resources/app/node_modules/text-buffer/lib/buffer-patch.js:74:21)
  at Transaction.module.exports.Transaction.applyTo (/usr/share/atom/resources/app/node_modules/text-buffer/lib/transaction.js:60:29)
  at History.module.exports.History.abortTransaction (/usr/share/atom/resources/app/node_modules/text-buffer/lib/history.js:162:24)
  at History.module.exports.History.transact (/usr/share/atom/resources/app/node_modules/text-buffer/lib/history.js:119:16)
  at TextBuffer.module.exports.TextBuffer.transact (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:683:27)
  at TextEditor.module.exports.TextEditor.transact (/usr/share/atom/resources/app/src/text-editor.js:1146:26)
  at atom-text-editor.newCommandListeners.(anonymous function) (/usr/share/atom/resources/app/src/text-editor-element.js:290:22)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:243:29)
  at /usr/share/atom/resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:549:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:391:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/usr/share/atom/resources/app/src/window-event-handler.js:167:20)
</code></pre></div>