{"action":"created","issue":{"url":"https://api.github.com/repos/eaburns/T/issues/134","repository_url":"https://api.github.com/repos/eaburns/T","labels_url":"https://api.github.com/repos/eaburns/T/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/eaburns/T/issues/134/comments","events_url":"https://api.github.com/repos/eaburns/T/issues/134/events","html_url":"https://github.com/eaburns/T/issues/134","id":127035185,"number":134,"title":"Consider rewriting edit/runes to use UTF-8","user":{"login":"eaburns","id":235271,"avatar_url":"https://avatars.githubusercontent.com/u/235271?v=3","gravatar_id":"","url":"https://api.github.com/users/eaburns","html_url":"https://github.com/eaburns","followers_url":"https://api.github.com/users/eaburns/followers","following_url":"https://api.github.com/users/eaburns/following{/other_user}","gists_url":"https://api.github.com/users/eaburns/gists{/gist_id}","starred_url":"https://api.github.com/users/eaburns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eaburns/subscriptions","organizations_url":"https://api.github.com/users/eaburns/orgs","repos_url":"https://api.github.com/users/eaburns/repos","events_url":"https://api.github.com/users/eaburns/events{/privacy}","received_events_url":"https://api.github.com/users/eaburns/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eaburns/T/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"mccoyst","id":668971,"avatar_url":"https://avatars.githubusercontent.com/u/668971?v=3","gravatar_id":"","url":"https://api.github.com/users/mccoyst","html_url":"https://github.com/mccoyst","followers_url":"https://api.github.com/users/mccoyst/followers","following_url":"https://api.github.com/users/mccoyst/following{/other_user}","gists_url":"https://api.github.com/users/mccoyst/gists{/gist_id}","starred_url":"https://api.github.com/users/mccoyst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mccoyst/subscriptions","organizations_url":"https://api.github.com/users/mccoyst/orgs","repos_url":"https://api.github.com/users/mccoyst/repos","events_url":"https://api.github.com/users/mccoyst/events{/privacy}","received_events_url":"https://api.github.com/users/mccoyst/received_events","type":"User","site_admin":false},"milestone":null,"comments":14,"created_at":"2016-01-16T16:34:56Z","updated_at":"2016-02-29T02:08:03Z","closed_at":null,"body":"This would have the benefit of eliminating copying, requiring less memory, and eliminating the need for rune->byte conversions, and we could use io.Reader, io.Writer, and friends instead of Runes versions of these.\r\n\r\nCheckout https://godoc.org/golang.org/x/exp/utf8string for inspiration."},"comment":{"url":"https://api.github.com/repos/eaburns/T/issues/comments/189996225","html_url":"https://github.com/eaburns/T/issues/134#issuecomment-189996225","issue_url":"https://api.github.com/repos/eaburns/T/issues/134","id":189996225,"user":{"login":"eaburns","id":235271,"avatar_url":"https://avatars.githubusercontent.com/u/235271?v=3","gravatar_id":"","url":"https://api.github.com/users/eaburns","html_url":"https://github.com/eaburns","followers_url":"https://api.github.com/users/eaburns/followers","following_url":"https://api.github.com/users/eaburns/following{/other_user}","gists_url":"https://api.github.com/users/eaburns/gists{/gist_id}","starred_url":"https://api.github.com/users/eaburns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eaburns/subscriptions","organizations_url":"https://api.github.com/users/eaburns/orgs","repos_url":"https://api.github.com/users/eaburns/repos","events_url":"https://api.github.com/users/eaburns/events{/privacy}","received_events_url":"https://api.github.com/users/eaburns/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T02:08:03Z","updated_at":"2016-02-29T02:08:03Z","body":"Thanks for the suggestion. I'm not familiar with CRDTs, but according to Wikipedia they are useful for distributed algorithms. The plan here is to be completely centralized. Let me explain further and see if you still think they are appropriate. If so, could you please point me at some reading material?\n\nThe problem here is updating the address range of a mark during an undo. For example, if #2,#3 is marked as 'm and rune #0,#1 is deleted, 'm would update to #1,#2; a rune before it was deleted, so it moves one rune earlier. If we don't know how the buffer contents changed during an undo (the deltas) but only what the contents changed to, how can we update the address?\n\nHere's a concrete example:\n\nBefore an undo, the buffer text is \"abcdef\" and mark 'm is the empty string after \"abc\" and before \"def\". After undo, the buffer becomes \"a1234bcdef\". Where should we move 'm? It's hard to say. Maybe it remains between the c and the d?\n\nNow, what if I told you the delta: the undo changed \"abcde\" to \"a1234bcde\". Now we can follow the standard update rules. The update completely overlaps 'm, so 'm moves to the beginning of the change: in this case #0."}}