{"action":"created","issue":{"url":"https://api.github.com/repos/codemirror/CodeMirror/issues/3548","labels_url":"https://api.github.com/repos/codemirror/CodeMirror/issues/3548/labels{/name}","comments_url":"https://api.github.com/repos/codemirror/CodeMirror/issues/3548/comments","events_url":"https://api.github.com/repos/codemirror/CodeMirror/issues/3548/events","html_url":"https://github.com/codemirror/CodeMirror/issues/3548","id":108243964,"number":3548,"title":"hardwrap addon can infinite loop & OOM","user":{"login":"mtaran-google","id":5050719,"avatar_url":"https://avatars.githubusercontent.com/u/5050719?v=3","gravatar_id":"","url":"https://api.github.com/users/mtaran-google","html_url":"https://github.com/mtaran-google","followers_url":"https://api.github.com/users/mtaran-google/followers","following_url":"https://api.github.com/users/mtaran-google/following{/other_user}","gists_url":"https://api.github.com/users/mtaran-google/gists{/gist_id}","starred_url":"https://api.github.com/users/mtaran-google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtaran-google/subscriptions","organizations_url":"https://api.github.com/users/mtaran-google/orgs","repos_url":"https://api.github.com/users/mtaran-google/repos","events_url":"https://api.github.com/users/mtaran-google/events{/privacy}","received_events_url":"https://api.github.com/users/mtaran-google/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-25T01:12:04Z","updated_at":"2015-09-25T09:14:27Z","closed_at":"2015-09-25T09:14:27Z","body":"A repro case is \r\n\r\n```\r\n    implemented using an Android [`TextureView`](http://developer.android.com/reference/android/view/TextureView.html).\r\n\r\n```\r\n(with the newline above and below, and +4 indent)\r\n\r\nif you then call editor.wrapRange({line:1, ch:0}, {line:1, ch:null}, {column:80}) it goes into an infinite loop and steadily increases memory usage of that process."},"comment":{"url":"https://api.github.com/repos/codemirror/CodeMirror/issues/comments/143167026","html_url":"https://github.com/codemirror/CodeMirror/issues/3548#issuecomment-143167026","issue_url":"https://api.github.com/repos/codemirror/CodeMirror/issues/3548","id":143167026,"user":{"login":"marijnh","id":144427,"avatar_url":"https://avatars.githubusercontent.com/u/144427?v=3","gravatar_id":"","url":"https://api.github.com/users/marijnh","html_url":"https://github.com/marijnh","followers_url":"https://api.github.com/users/marijnh/followers","following_url":"https://api.github.com/users/marijnh/following{/other_user}","gists_url":"https://api.github.com/users/marijnh/gists{/gist_id}","starred_url":"https://api.github.com/users/marijnh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marijnh/subscriptions","organizations_url":"https://api.github.com/users/marijnh/orgs","repos_url":"https://api.github.com/users/marijnh/repos","events_url":"https://api.github.com/users/marijnh/events{/privacy}","received_events_url":"https://api.github.com/users/marijnh/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T09:14:27Z","updated_at":"2015-09-25T09:14:27Z","body":"I assume you are doing something like what the demo is (was) doing, reacting to every changes with a new call to `wrapParagraphsInRange`. It is cheaper to suppress this effect for changes generated by the hardwrap addon (see d708748a9c3) but I've also updated the addon (edfe2106348c5c) to not emit any changes when there's nothing to change (it was creating an empty change, endlessly re-triggering the event handler)."}}