{"action":"closed","number":462,"pull_request":{"url":"https://api.github.com/repos/Code52/DownmarkerWPF/pulls/462","id":59965644,"html_url":"https://github.com/Code52/DownmarkerWPF/pull/462","diff_url":"https://github.com/Code52/DownmarkerWPF/pull/462.diff","patch_url":"https://github.com/Code52/DownmarkerWPF/pull/462.patch","issue_url":"https://api.github.com/repos/Code52/DownmarkerWPF/issues/462","number":462,"state":"closed","locked":false,"title":"Fixed replacement & selection logic","user":{"login":"Timothep","id":594373,"avatar_url":"https://avatars.githubusercontent.com/u/594373?v=3","gravatar_id":"","url":"https://api.github.com/users/Timothep","html_url":"https://github.com/Timothep","followers_url":"https://api.github.com/users/Timothep/followers","following_url":"https://api.github.com/users/Timothep/following{/other_user}","gists_url":"https://api.github.com/users/Timothep/gists{/gist_id}","starred_url":"https://api.github.com/users/Timothep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Timothep/subscriptions","organizations_url":"https://api.github.com/users/Timothep/orgs","repos_url":"https://api.github.com/users/Timothep/repos","events_url":"https://api.github.com/users/Timothep/events{/privacy}","received_events_url":"https://api.github.com/users/Timothep/received_events","type":"User","site_admin":false},"body":"Hi there, I fixed the selection logic following a replace action (#401).\r\n\r\n* First I extracted a Replace function\r\n* Then I replaced the LINQ Query searching for the next element to replace with an Avalon function:\r\n\r\n`var foundHit = (SearchHits as TextSegmentCollection<TextSegment>).FindFirstSegmentWithStartAfter(startLookingFrom);`\r\n\r\n* Finally I updated the selection in the TextArea with the delta-length between the text removed and the text that was added.\r\n\r\nI hope I didn't miss any corner case.\r\n\r\nCheers,\r\nTim\r\n\r\nClosed: #401 ","created_at":"2016-02-19T15:42:14Z","updated_at":"2016-02-29T20:10:10Z","closed_at":"2016-02-29T20:10:09Z","merged_at":"2016-02-29T20:10:09Z","merge_commit_sha":"502640151b59cde960f177c76d44be2ecfb9582e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Code52/DownmarkerWPF/pulls/462/commits","review_comments_url":"https://api.github.com/repos/Code52/DownmarkerWPF/pulls/462/comments","review_comment_url":"https://api.github.com/repos/Code52/DownmarkerWPF/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Code52/DownmarkerWPF/issues/462/comments","statuses_url":"https://api.github.com/repos/Code52/DownmarkerWPF/statuses/930ba187d675c498f467ddce2fe4f36651a9189c","head":{"label":"Timothep:master","ref":"master","sha":"930ba187d675c498f467ddce2fe4f36651a9189c","user":{"login":"Timothep","id":594373,"avatar_url":"https://avatars.githubusercontent.com/u/594373?v=3","gravatar_id":"","url":"https://api.github.com/users/Timothep","html_url":"https://github.com/Timothep","followers_url":"https://api.github.com/users/Timothep/followers","following_url":"https://api.github.com/users/Timothep/following{/other_user}","gists_url":"https://api.github.com/users/Timothep/gists{/gist_id}","starred_url":"https://api.github.com/users/Timothep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Timothep/subscriptions","organizations_url":"https://api.github.com/users/Timothep/orgs","repos_url":"https://api.github.com/users/Timothep/repos","events_url":"https://api.github.com/users/Timothep/events{/privacy}","received_events_url":"https://api.github.com/users/Timothep/received_events","type":"User","site_admin":false},"repo":{"id":52080966,"name":"DownmarkerWPF","full_name":"Timothep/DownmarkerWPF","owner":{"login":"Timothep","id":594373,"avatar_url":"https://avatars.githubusercontent.com/u/594373?v=3","gravatar_id":"","url":"https://api.github.com/users/Timothep","html_url":"https://github.com/Timothep","followers_url":"https://api.github.com/users/Timothep/followers","following_url":"https://api.github.com/users/Timothep/following{/other_user}","gists_url":"https://api.github.com/users/Timothep/gists{/gist_id}","starred_url":"https://api.github.com/users/Timothep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Timothep/subscriptions","organizations_url":"https://api.github.com/users/Timothep/orgs","repos_url":"https://api.github.com/users/Timothep/repos","events_url":"https://api.github.com/users/Timothep/events{/privacy}","received_events_url":"https://api.github.com/users/Timothep/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Timothep/DownmarkerWPF","description":"MarkPad - a visual Markdown editor (inspired by the Downmarker project)","fork":true,"url":"https://api.github.com/repos/Timothep/DownmarkerWPF","forks_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/forks","keys_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/teams","hooks_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/hooks","issue_events_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/issues/events{/number}","events_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/events","assignees_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/assignees{/user}","branches_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/branches{/branch}","tags_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/tags","blobs_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/git/refs{/sha}","trees_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/statuses/{sha}","languages_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/languages","stargazers_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/stargazers","contributors_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/contributors","subscribers_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/subscribers","subscription_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/subscription","commits_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/commits{/sha}","git_commits_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/git/commits{/sha}","comments_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/comments{/number}","issue_comment_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/issues/comments{/number}","contents_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/contents/{+path}","compare_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/merges","archive_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/downloads","issues_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/issues{/number}","pulls_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/pulls{/number}","milestones_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/milestones{/number}","notifications_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/labels{/name}","releases_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/releases{/id}","deployments_url":"https://api.github.com/repos/Timothep/DownmarkerWPF/deployments","created_at":"2016-02-19T10:36:35Z","updated_at":"2016-02-19T10:36:37Z","pushed_at":"2016-02-19T15:37:12Z","git_url":"git://github.com/Timothep/DownmarkerWPF.git","ssh_url":"git@github.com:Timothep/DownmarkerWPF.git","clone_url":"https://github.com/Timothep/DownmarkerWPF.git","svn_url":"https://github.com/Timothep/DownmarkerWPF","homepage":"http://code52.org/DownmarkerWPF/","size":81337,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Code52:master","ref":"master","sha":"f6651715c7fe932dfdf2fbe314d9344dbcc858c0","user":{"login":"Code52","id":1266849,"avatar_url":"https://avatars.githubusercontent.com/u/1266849?v=3","gravatar_id":"","url":"https://api.github.com/users/Code52","html_url":"https://github.com/Code52","followers_url":"https://api.github.com/users/Code52/followers","following_url":"https://api.github.com/users/Code52/following{/other_user}","gists_url":"https://api.github.com/users/Code52/gists{/gist_id}","starred_url":"https://api.github.com/users/Code52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Code52/subscriptions","organizations_url":"https://api.github.com/users/Code52/orgs","repos_url":"https://api.github.com/users/Code52/repos","events_url":"https://api.github.com/users/Code52/events{/privacy}","received_events_url":"https://api.github.com/users/Code52/received_events","type":"Organization","site_admin":false},"repo":{"id":3068358,"name":"DownmarkerWPF","full_name":"Code52/DownmarkerWPF","owner":{"login":"Code52","id":1266849,"avatar_url":"https://avatars.githubusercontent.com/u/1266849?v=3","gravatar_id":"","url":"https://api.github.com/users/Code52","html_url":"https://github.com/Code52","followers_url":"https://api.github.com/users/Code52/followers","following_url":"https://api.github.com/users/Code52/following{/other_user}","gists_url":"https://api.github.com/users/Code52/gists{/gist_id}","starred_url":"https://api.github.com/users/Code52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Code52/subscriptions","organizations_url":"https://api.github.com/users/Code52/orgs","repos_url":"https://api.github.com/users/Code52/repos","events_url":"https://api.github.com/users/Code52/events{/privacy}","received_events_url":"https://api.github.com/users/Code52/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Code52/DownmarkerWPF","description":"MarkPad - a visual Markdown editor (inspired by the Downmarker project)","fork":false,"url":"https://api.github.com/repos/Code52/DownmarkerWPF","forks_url":"https://api.github.com/repos/Code52/DownmarkerWPF/forks","keys_url":"https://api.github.com/repos/Code52/DownmarkerWPF/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Code52/DownmarkerWPF/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Code52/DownmarkerWPF/teams","hooks_url":"https://api.github.com/repos/Code52/DownmarkerWPF/hooks","issue_events_url":"https://api.github.com/repos/Code52/DownmarkerWPF/issues/events{/number}","events_url":"https://api.github.com/repos/Code52/DownmarkerWPF/events","assignees_url":"https://api.github.com/repos/Code52/DownmarkerWPF/assignees{/user}","branches_url":"https://api.github.com/repos/Code52/DownmarkerWPF/branches{/branch}","tags_url":"https://api.github.com/repos/Code52/DownmarkerWPF/tags","blobs_url":"https://api.github.com/repos/Code52/DownmarkerWPF/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Code52/DownmarkerWPF/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Code52/DownmarkerWPF/git/refs{/sha}","trees_url":"https://api.github.com/repos/Code52/DownmarkerWPF/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Code52/DownmarkerWPF/statuses/{sha}","languages_url":"https://api.github.com/repos/Code52/DownmarkerWPF/languages","stargazers_url":"https://api.github.com/repos/Code52/DownmarkerWPF/stargazers","contributors_url":"https://api.github.com/repos/Code52/DownmarkerWPF/contributors","subscribers_url":"https://api.github.com/repos/Code52/DownmarkerWPF/subscribers","subscription_url":"https://api.github.com/repos/Code52/DownmarkerWPF/subscription","commits_url":"https://api.github.com/repos/Code52/DownmarkerWPF/commits{/sha}","git_commits_url":"https://api.github.com/repos/Code52/DownmarkerWPF/git/commits{/sha}","comments_url":"https://api.github.com/repos/Code52/DownmarkerWPF/comments{/number}","issue_comment_url":"https://api.github.com/repos/Code52/DownmarkerWPF/issues/comments{/number}","contents_url":"https://api.github.com/repos/Code52/DownmarkerWPF/contents/{+path}","compare_url":"https://api.github.com/repos/Code52/DownmarkerWPF/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Code52/DownmarkerWPF/merges","archive_url":"https://api.github.com/repos/Code52/DownmarkerWPF/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Code52/DownmarkerWPF/downloads","issues_url":"https://api.github.com/repos/Code52/DownmarkerWPF/issues{/number}","pulls_url":"https://api.github.com/repos/Code52/DownmarkerWPF/pulls{/number}","milestones_url":"https://api.github.com/repos/Code52/DownmarkerWPF/milestones{/number}","notifications_url":"https://api.github.com/repos/Code52/DownmarkerWPF/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Code52/DownmarkerWPF/labels{/name}","releases_url":"https://api.github.com/repos/Code52/DownmarkerWPF/releases{/id}","deployments_url":"https://api.github.com/repos/Code52/DownmarkerWPF/deployments","created_at":"2011-12-29T11:30:43Z","updated_at":"2016-02-26T08:31:08Z","pushed_at":"2016-02-29T20:10:09Z","git_url":"git://github.com/Code52/DownmarkerWPF.git","ssh_url":"git@github.com:Code52/DownmarkerWPF.git","clone_url":"https://github.com/Code52/DownmarkerWPF.git","svn_url":"https://github.com/Code52/DownmarkerWPF","homepage":"http://code52.org/DownmarkerWPF/","size":147295,"stargazers_count":944,"watchers_count":944,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":370,"mirror_url":null,"open_issues_count":61,"forks":370,"open_issues":61,"watchers":944,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Code52/DownmarkerWPF/pulls/462"},"html":{"href":"https://github.com/Code52/DownmarkerWPF/pull/462"},"issue":{"href":"https://api.github.com/repos/Code52/DownmarkerWPF/issues/462"},"comments":{"href":"https://api.github.com/repos/Code52/DownmarkerWPF/issues/462/comments"},"review_comments":{"href":"https://api.github.com/repos/Code52/DownmarkerWPF/pulls/462/comments"},"review_comment":{"href":"https://api.github.com/repos/Code52/DownmarkerWPF/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Code52/DownmarkerWPF/pulls/462/commits"},"statuses":{"href":"https://api.github.com/repos/Code52/DownmarkerWPF/statuses/930ba187d675c498f467ddce2fe4f36651a9189c"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"shiftkey","id":359239,"avatar_url":"https://avatars.githubusercontent.com/u/359239?v=3","gravatar_id":"","url":"https://api.github.com/users/shiftkey","html_url":"https://github.com/shiftkey","followers_url":"https://api.github.com/users/shiftkey/followers","following_url":"https://api.github.com/users/shiftkey/following{/other_user}","gists_url":"https://api.github.com/users/shiftkey/gists{/gist_id}","starred_url":"https://api.github.com/users/shiftkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiftkey/subscriptions","organizations_url":"https://api.github.com/users/shiftkey/orgs","repos_url":"https://api.github.com/users/shiftkey/repos","events_url":"https://api.github.com/users/shiftkey/events{/privacy}","received_events_url":"https://api.github.com/users/shiftkey/received_events","type":"User","site_admin":true},"comments":6,"review_comments":0,"commits":2,"additions":33,"deletions":21,"changed_files":1}}