{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/monaco-editor/issues/913","repository_url":"https://api.github.com/repos/Microsoft/monaco-editor","labels_url":"https://api.github.com/repos/Microsoft/monaco-editor/issues/913/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/monaco-editor/issues/913/comments","events_url":"https://api.github.com/repos/Microsoft/monaco-editor/issues/913/events","html_url":"https://github.com/Microsoft/monaco-editor/issues/913","id":330964370,"node_id":"MDU6SXNzdWUzMzA5NjQzNzA=","number":913,"title":"Duplicate decorators when user has press enter for new line","user":{"login":"oleg-webdev","id":4804068,"node_id":"MDQ6VXNlcjQ4MDQwNjg=","avatar_url":"https://avatars3.githubusercontent.com/u/4804068?v=4","gravatar_id":"","url":"https://api.github.com/users/oleg-webdev","html_url":"https://github.com/oleg-webdev","followers_url":"https://api.github.com/users/oleg-webdev/followers","following_url":"https://api.github.com/users/oleg-webdev/following{/other_user}","gists_url":"https://api.github.com/users/oleg-webdev/gists{/gist_id}","starred_url":"https://api.github.com/users/oleg-webdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleg-webdev/subscriptions","organizations_url":"https://api.github.com/users/oleg-webdev/orgs","repos_url":"https://api.github.com/users/oleg-webdev/repos","events_url":"https://api.github.com/users/oleg-webdev/events{/privacy}","received_events_url":"https://api.github.com/users/oleg-webdev/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-10T12:23:03Z","updated_at":"2018-06-13T09:56:22Z","closed_at":"2018-06-13T09:56:22Z","author_association":"NONE","body":"[Accordingly to guide](https://microsoft.github.io/monaco-editor/playground.html#interacting-with-the-editor-rendering-glyphs-in-the-margin), I've set markers with deltaDecorations like so:\r\nWhen gutter has been clicked\r\n```\r\neditor.onMouseDown((e) => {\r\n        const { target: { element, range } } = e;\r\n        if (element.className === 'line-numbers') {\r\n          //...\r\n        }\r\n      });\r\n```\r\ndoing some checks and set marker:\r\n```\r\neditor.deltaDecorations(\r\n      [], [{\r\n        range: new monaco.Range(line, 1, line, 1),\r\n        options: {\r\n          isWholeLine: true,\r\n          className: 'myContentClass',\r\n          linesDecorationsClassName: 'breakpointStyle'\r\n        }\r\n      }]);\r\n```\r\nAll is fine till \"enter\" has been pressed on line, which contains a decorator.\r\nThis action has side effect - new line inserted with decorator\r\n[Preview](https://media.giphy.com/media/uinNvspvNyimbyQ1GD/giphy.gif)\r\nhttps://media.giphy.com/media/uinNvspvNyimbyQ1GD/giphy.gif\r\nWhy does it happend and how can I prevent duplicated decorators?"}}
{"actor":{"display_login":"oleg-webdev"}}