{"action":"opened","issue":{"url":"https://api.github.com/repos/sindresorhus/atom-esformatter/issues/28","labels_url":"https://api.github.com/repos/sindresorhus/atom-esformatter/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/sindresorhus/atom-esformatter/issues/28/comments","events_url":"https://api.github.com/repos/sindresorhus/atom-esformatter/issues/28/events","html_url":"https://github.com/sindresorhus/atom-esformatter/issues/28","id":108876913,"number":28,"title":"Uncaught Error: This TextEditor has been destroyed","user":{"login":"smwht","id":5693657,"avatar_url":"https://avatars.githubusercontent.com/u/5693657?v=3","gravatar_id":"","url":"https://api.github.com/users/smwht","html_url":"https://github.com/smwht","followers_url":"https://api.github.com/users/smwht/followers","following_url":"https://api.github.com/users/smwht/following{/other_user}","gists_url":"https://api.github.com/users/smwht/gists{/gist_id}","starred_url":"https://api.github.com/users/smwht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smwht/subscriptions","organizations_url":"https://api.github.com/users/smwht/orgs","repos_url":"https://api.github.com/users/smwht/repos","events_url":"https://api.github.com/users/smwht/events{/privacy}","received_events_url":"https://api.github.com/users/smwht/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-29T14:05:31Z","updated_at":"2015-09-29T14:05:31Z","closed_at":null,"body":"[Enter steps to reproduce below:]\r\n\r\n1. CTRL-K arrow to split window.\r\n2. Close original tab.\r\n3. Save file.\r\n\r\n**Atom Version**: 1.0.19\r\n**System**: Linux Mint\r\n**Thrown From**: [esformatter](https://github.com/sindresorhus/atom-esformatter) package, v1.13.0\r\n\r\n\r\n### Stack Trace\r\n\r\nUncaught Error: This TextEditor has been destroyed\r\n\r\n```\r\nAt /opt/atom/resources/app.asar/src/pane.js:809\r\n\r\nError: This TextEditor has been destroyed\r\n  at DisplayBuffer.module.exports.DisplayBuffer.screenPositionForBufferPosition (/opt/atom/resources/app.asar/src/display-buffer.js:1097:15)\r\n  at Marker.module.exports.Marker.getHeadScreenPosition (/opt/atom/resources/app.asar/src/marker.js:179:33)\r\n  at Cursor.module.exports.Cursor.getScreenPosition (/opt/atom/resources/app.asar/src/cursor.js:90:26)\r\n  at Cursor.module.exports.Cursor.getScreenRange (/opt/atom/resources/app.asar/src/cursor.js:708:20)\r\n  at Cursor.module.exports.Cursor.autoscroll (/opt/atom/resources/app.asar/src/cursor.js:713:51)\r\n  at Cursor.module.exports.Cursor.changePosition (/opt/atom/resources/app.asar/src/cursor.js:698:21)\r\n  at Cursor.module.exports.Cursor.setBufferPosition (/opt/atom/resources/app.asar/src/cursor.js:97:19)\r\n  at /opt/atom/resources/app.asar/src/text-editor.js:1354:23\r\n  at TextEditor.module.exports.TextEditor.moveCursors (/opt/atom/resources/app.asar/src/text-editor.js:1593:9)\r\n  at TextEditor.module.exports.TextEditor.setCursorBufferPosition (/opt/atom/resources/app.asar/src/text-editor.js:1353:19)\r\n  at init (/home/mikael/.atom/packages/esformatter/index.js:42:9)\r\n  at /home/mikael/.atom/packages/esformatter/index.js:63:5\r\n  at Emitter.module.exports.Emitter.emit (/opt/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)\r\n  at TextBuffer.module.exports.TextBuffer.saveAs (/opt/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1012:20)\r\n  at TextBuffer.module.exports.TextBuffer.save (/opt/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1004:19)\r\n  at TextEditor.module.exports.TextEditor.save (/opt/atom/resources/app.asar/src/text-editor.js:584:26)\r\n  at Pane.module.exports.Pane.saveItem (/opt/atom/resources/app.asar/src/pane.js:547:18)\r\n  at Pane.module.exports.Pane.saveActiveItem (/opt/atom/resources/app.asar/src/pane.js:530:19)\r\n  at Workspace.module.exports.Workspace.saveActivePaneItem (/opt/atom/resources/app.asar/src/workspace.js:609:35)\r\n  at atom-workspace.atom.commands.add.core:save (/opt/atom/resources/app.asar/src/workspace-element.js:293:30)\r\n  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/opt/atom/resources/app.asar/src/command-registry.js:245:29)\r\n  at /opt/atom/resources/app.asar/src/command-registry.js:3:61\r\n  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/opt/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:524:16)\r\n  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/opt/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:347:22)\r\n  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/opt/atom/resources/app.asar/src/window-event-handler.js:184:20)\r\n\r\n```\r\n\r\n### Commands\r\n\r\n```\r\n     -2:55.3.0 core:backspace (atom-text-editor.editor.is-focused)\r\n  2x -2:54.7.0 core:save (atom-text-editor.editor.is-focused)\r\n     -2:35.3.0 core:close (atom-text-editor.editor)\r\n     -1:43.7.0 core:save (atom-text-editor.editor.is-focused)\r\n     -1:41.8.0 pane:split-right (atom-text-editor.editor.is-focused)\r\n     -1:39.8.0 core:save (atom-text-editor.editor.is-focused)\r\n     -1:38.7.0 core:close (atom-text-editor.editor.is-focused)\r\n     -1:37.7.0 core:save (atom-text-editor.editor.is-focused)\r\n     -0:26.5.0 core:close (atom-text-editor.editor.is-focused)\r\n     -0:19.5.0 pane:split-right (atom-text-editor.editor.is-focused)\r\n     -0:17.5.0 core:save (atom-text-editor.editor.is-focused)\r\n     -0:16.1.0 core:close (atom-text-editor.editor.is-focused)\r\n     -0:05.9.0 pane:split-right (atom-text-editor.editor.is-focused)\r\n     -0:03.6.0 core:save (atom-text-editor.editor.is-focused)\r\n     -0:01.7.0 core:close (atom-text-editor.editor.is-focused)\r\n     -0:00.7.0 core:save (atom-text-editor.editor.is-focused)\r\n```\r\n\r\n### Config\r\n\r\n```json\r\n{\r\n  // (...)\r\n  \"esformatter\": {\r\n    \"formatOnSave\": true\r\n  }\r\n}\r\n```\r\n"}}