{"action":"created","issue":{"url":"https://api.github.com/repos/atom/atom/issues/15582","repository_url":"https://api.github.com/repos/atom/atom","labels_url":"https://api.github.com/repos/atom/atom/issues/15582/labels{/name}","comments_url":"https://api.github.com/repos/atom/atom/issues/15582/comments","events_url":"https://api.github.com/repos/atom/atom/issues/15582/events","html_url":"https://github.com/atom/atom/issues/15582","id":255961380,"number":15582,"title":"[1.19.6/1.20.0-beta6] Block decorations mess up editor content when destroyed","user":{"login":"lgeiger","id":13285808,"avatar_url":"https://avatars1.githubusercontent.com/u/13285808?v=4","gravatar_id":"","url":"https://api.github.com/users/lgeiger","html_url":"https://github.com/lgeiger","followers_url":"https://api.github.com/users/lgeiger/followers","following_url":"https://api.github.com/users/lgeiger/following{/other_user}","gists_url":"https://api.github.com/users/lgeiger/gists{/gist_id}","starred_url":"https://api.github.com/users/lgeiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgeiger/subscriptions","organizations_url":"https://api.github.com/users/lgeiger/orgs","repos_url":"https://api.github.com/users/lgeiger/repos","events_url":"https://api.github.com/users/lgeiger/events{/privacy}","received_events_url":"https://api.github.com/users/lgeiger/received_events","type":"User","site_admin":false},"labels":[{"id":33602150,"url":"https://api.github.com/repos/atom/atom/labels/bug","name":"bug","color":"f7c6c7","default":true},{"id":418477269,"url":"https://api.github.com/repos/atom/atom/labels/regression","name":"regression","color":"b60205","default":false},{"id":505038679,"url":"https://api.github.com/repos/atom/atom/labels/triaged","name":"triaged","color":"00bb00","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-09-07T14:42:31Z","updated_at":"2017-09-07T15:59:23Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<!--\r\n\r\nHave you read Atom's Code of Conduct? By filing an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/atom/atom/blob/master/CODE_OF_CONDUCT.md\r\n\r\nDo you want to ask a question? Are you looking for support? The Atom message board is the best place for getting support: https://discuss.atom.io\r\n\r\n-->\r\n\r\n### Prerequisites\r\n\r\n* [x] Put an X between the brackets on this line if you have done all of the following:\r\n    * Reproduced the problem in Safe Mode: http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode\r\n    * Followed all applicable steps in the debugging guide: http://flight-manual.atom.io/hacking-atom/sections/debugging/\r\n    * Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq\r\n    * Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom\r\n    * Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages\r\n\r\n### Description\r\n\r\nBlock decorations mess up line numbers and editor content once destroyed.\r\nThe issue was originally reported by @srk-srinivasan on the Hydrogen repo: https://github.com/nteract/hydrogen/issues/981\r\n\r\nThis worked correctly till Atom 1.19.5 and 1.20.0-beta5.\r\n\r\n### Steps to Reproduce\r\n\r\n1. Open file with a few lines of code\r\n2. Execute the following code in dev tools:\r\n```js\r\nfunction createBlock(row) {\r\n  const item = document.createElement(\"span\");\r\n  item.innerText = \"[block decoration]\\n[block decoration]\\n[block decoration]\";\r\n  const editor = atom.workspace.getActiveTextEditor();\r\n  const marker = editor.markBufferPosition([row, 0]);\r\n  editor.decorateMarker(marker, { type: \"block\", item: item });\r\n  return marker;\r\n}\r\n\r\nconst marker = createBlock(5);\r\n```\r\n\r\n3. Destroy marker with\r\n```js\r\nmarker.destroy();\r\n```\r\n\r\n**Expected behavior: (Atom 1.19.5 / 1.20.0-beta5)**\r\nEditor correctly renders as if the block decoration was never there.\r\n\r\n**Actual behavior: (Atom 1.19.6 / 1.20.0-beta6)**\r\nEditor doesn't correctly re-render and messes up line numbering and editor content:\r\n![destroy](https://user-images.githubusercontent.com/13285808/30168951-3632efee-93eb-11e7-95f0-9df28a50a798.gif)\r\n\r\n\r\n**Reproduces how often:** 100%\r\n\r\n### Versions\r\n\r\nAtom 1.19.6 and 1.20.0-beta6\r\n\r\n### Additional Information\r\n\r\n@as-cii This regression was likely introduced in #15503 or #15528\r\n"},"comment":{"url":"https://api.github.com/repos/atom/atom/issues/comments/327844516","html_url":"https://github.com/atom/atom/issues/15582#issuecomment-327844516","issue_url":"https://api.github.com/repos/atom/atom/issues/15582","id":327844516,"user":{"login":"as-cii","id":482957,"avatar_url":"https://avatars0.githubusercontent.com/u/482957?v=4","gravatar_id":"","url":"https://api.github.com/users/as-cii","html_url":"https://github.com/as-cii","followers_url":"https://api.github.com/users/as-cii/followers","following_url":"https://api.github.com/users/as-cii/following{/other_user}","gists_url":"https://api.github.com/users/as-cii/gists{/gist_id}","starred_url":"https://api.github.com/users/as-cii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/as-cii/subscriptions","organizations_url":"https://api.github.com/users/as-cii/orgs","repos_url":"https://api.github.com/users/as-cii/repos","events_url":"https://api.github.com/users/as-cii/events{/privacy}","received_events_url":"https://api.github.com/users/as-cii/received_events","type":"User","site_admin":true},"created_at":"2017-09-07T15:59:23Z","updated_at":"2017-09-07T15:59:23Z","author_association":"OWNER","body":"Apologies for this regression and thanks for the report, @lgeiger. I have already provided a fix for it which will be included in the next hotfix releases."}}
{"actor":{"display_login":"as-cii"}}