{"action":"opened","number":104,"pull_request":{"url":"https://api.github.com/repos/google/xi-editor/pulls/104","id":78660444,"html_url":"https://github.com/google/xi-editor/pull/104","diff_url":"https://github.com/google/xi-editor/pull/104.diff","patch_url":"https://github.com/google/xi-editor/pull/104.patch","issue_url":"https://api.github.com/repos/google/xi-editor/issues/104","number":104,"state":"open","locked":false,"title":"Propagate Plugin changes to frontend","user":{"login":"rkusa","id":409021,"avatar_url":"https://avatars.githubusercontent.com/u/409021?v=3","gravatar_id":"","url":"https://api.github.com/users/rkusa","html_url":"https://github.com/rkusa","followers_url":"https://api.github.com/users/rkusa/followers","following_url":"https://api.github.com/users/rkusa/following{/other_user}","gists_url":"https://api.github.com/users/rkusa/gists{/gist_id}","starred_url":"https://api.github.com/users/rkusa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkusa/subscriptions","organizations_url":"https://api.github.com/users/rkusa/orgs","repos_url":"https://api.github.com/users/rkusa/repos","events_url":"https://api.github.com/users/rkusa/events{/privacy}","received_events_url":"https://api.github.com/users/rkusa/received_events","type":"User","site_admin":false},"body":"When thinking about my implementation of #101 during the last couple of days, I came to the conclusion that I prefer the idea of having the `TabCtx` as some kind of glue instead of making the editor to have references to everything.\r\n\r\nWith that in mind, the idea was now to introduce a `PluginCtx`, which is basically a `TabCtx` with an additional `PluginPeer`, even though this `PluginPeer` reference is not yet used. But it should pave the way for getting change notifications from the editor to its plugins. I also got rid of the nested `Arc` for the `MainPeer` (at least if I understood this one right).\r\n\r\nThings that could be improved:\r\n\r\n- [ ] I made the `TabCtx` cloneable, to be able to add a clone to the `PluginCtx`. Therefore, I had to wrap the `TabCtx` `kill_ring` into an `Arc`. Maybe there is better way to solve this?\r\n- [ ] Maybe it is possible to change the `rpc_peer` of the `PluginCtx` from `Option<PluginPeer>` to `PluginPeer`, but I wasn't able to achieve this because of the lifetime requirements of the plugin thread.\r\n- [ ] Do not run `editor.render()` after each plugin command, but rather collect some changes and send them in bulk. Not yet sure how to do implement this in a nice way ...\r\n- [ ] Implement notifications form editor to its plugins.\r\n\r\nFor the latter, it is probably necessary that either the tabs or the editor keeps a reference to the `PluginCtx`. However I am not yet sure how to implement this; e.g. should the `PluginCtx` be cloned or an `Arc` be used for the `PluginCtx`. Up to now, I am not quite happy with both, but I'll keep thinking about it.\r\n\r\nPlease understand this PR mainly as a basis for discussions. If you prefer the implementation without the `PluginCtx`, I am totally fine if we close this PR. Also, if some parts are hard to understand, please tell me and I'll try to rephrase them.\r\n","created_at":"2016-07-25T10:43:20Z","updated_at":"2016-07-25T10:43:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/xi-editor/pulls/104/commits","review_comments_url":"https://api.github.com/repos/google/xi-editor/pulls/104/comments","review_comment_url":"https://api.github.com/repos/google/xi-editor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/xi-editor/issues/104/comments","statuses_url":"https://api.github.com/repos/google/xi-editor/statuses/f8d56f6f11e841439bbae93d9f13856b5fa1411d","head":{"label":"rkusa:plugin-ctx","ref":"plugin-ctx","sha":"f8d56f6f11e841439bbae93d9f13856b5fa1411d","user":{"login":"rkusa","id":409021,"avatar_url":"https://avatars.githubusercontent.com/u/409021?v=3","gravatar_id":"","url":"https://api.github.com/users/rkusa","html_url":"https://github.com/rkusa","followers_url":"https://api.github.com/users/rkusa/followers","following_url":"https://api.github.com/users/rkusa/following{/other_user}","gists_url":"https://api.github.com/users/rkusa/gists{/gist_id}","starred_url":"https://api.github.com/users/rkusa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkusa/subscriptions","organizations_url":"https://api.github.com/users/rkusa/orgs","repos_url":"https://api.github.com/users/rkusa/repos","events_url":"https://api.github.com/users/rkusa/events{/privacy}","received_events_url":"https://api.github.com/users/rkusa/received_events","type":"User","site_admin":false},"repo":{"id":63628899,"name":"xi-editor","full_name":"rkusa/xi-editor","owner":{"login":"rkusa","id":409021,"avatar_url":"https://avatars.githubusercontent.com/u/409021?v=3","gravatar_id":"","url":"https://api.github.com/users/rkusa","html_url":"https://github.com/rkusa","followers_url":"https://api.github.com/users/rkusa/followers","following_url":"https://api.github.com/users/rkusa/following{/other_user}","gists_url":"https://api.github.com/users/rkusa/gists{/gist_id}","starred_url":"https://api.github.com/users/rkusa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkusa/subscriptions","organizations_url":"https://api.github.com/users/rkusa/orgs","repos_url":"https://api.github.com/users/rkusa/repos","events_url":"https://api.github.com/users/rkusa/events{/privacy}","received_events_url":"https://api.github.com/users/rkusa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rkusa/xi-editor","description":"A modern editor with a backend written in Rust.","fork":true,"url":"https://api.github.com/repos/rkusa/xi-editor","forks_url":"https://api.github.com/repos/rkusa/xi-editor/forks","keys_url":"https://api.github.com/repos/rkusa/xi-editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rkusa/xi-editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rkusa/xi-editor/teams","hooks_url":"https://api.github.com/repos/rkusa/xi-editor/hooks","issue_events_url":"https://api.github.com/repos/rkusa/xi-editor/issues/events{/number}","events_url":"https://api.github.com/repos/rkusa/xi-editor/events","assignees_url":"https://api.github.com/repos/rkusa/xi-editor/assignees{/user}","branches_url":"https://api.github.com/repos/rkusa/xi-editor/branches{/branch}","tags_url":"https://api.github.com/repos/rkusa/xi-editor/tags","blobs_url":"https://api.github.com/repos/rkusa/xi-editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rkusa/xi-editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rkusa/xi-editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/rkusa/xi-editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rkusa/xi-editor/statuses/{sha}","languages_url":"https://api.github.com/repos/rkusa/xi-editor/languages","stargazers_url":"https://api.github.com/repos/rkusa/xi-editor/stargazers","contributors_url":"https://api.github.com/repos/rkusa/xi-editor/contributors","subscribers_url":"https://api.github.com/repos/rkusa/xi-editor/subscribers","subscription_url":"https://api.github.com/repos/rkusa/xi-editor/subscription","commits_url":"https://api.github.com/repos/rkusa/xi-editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/rkusa/xi-editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/rkusa/xi-editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/rkusa/xi-editor/issues/comments{/number}","contents_url":"https://api.github.com/repos/rkusa/xi-editor/contents/{+path}","compare_url":"https://api.github.com/repos/rkusa/xi-editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rkusa/xi-editor/merges","archive_url":"https://api.github.com/repos/rkusa/xi-editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rkusa/xi-editor/downloads","issues_url":"https://api.github.com/repos/rkusa/xi-editor/issues{/number}","pulls_url":"https://api.github.com/repos/rkusa/xi-editor/pulls{/number}","milestones_url":"https://api.github.com/repos/rkusa/xi-editor/milestones{/number}","notifications_url":"https://api.github.com/repos/rkusa/xi-editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rkusa/xi-editor/labels{/name}","releases_url":"https://api.github.com/repos/rkusa/xi-editor/releases{/id}","deployments_url":"https://api.github.com/repos/rkusa/xi-editor/deployments","created_at":"2016-07-18T18:55:59Z","updated_at":"2016-07-18T18:56:00Z","pushed_at":"2016-07-25T10:42:40Z","git_url":"git://github.com/rkusa/xi-editor.git","ssh_url":"git@github.com:rkusa/xi-editor.git","clone_url":"https://github.com/rkusa/xi-editor.git","svn_url":"https://github.com/rkusa/xi-editor","homepage":"","size":925,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"google:master","ref":"master","sha":"b7dd8d2f7c6face9e93e7847b9336f3983fc3d78","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":57167764,"name":"xi-editor","full_name":"google/xi-editor","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/xi-editor","description":"A modern editor with a backend written in Rust.","fork":false,"url":"https://api.github.com/repos/google/xi-editor","forks_url":"https://api.github.com/repos/google/xi-editor/forks","keys_url":"https://api.github.com/repos/google/xi-editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/xi-editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/xi-editor/teams","hooks_url":"https://api.github.com/repos/google/xi-editor/hooks","issue_events_url":"https://api.github.com/repos/google/xi-editor/issues/events{/number}","events_url":"https://api.github.com/repos/google/xi-editor/events","assignees_url":"https://api.github.com/repos/google/xi-editor/assignees{/user}","branches_url":"https://api.github.com/repos/google/xi-editor/branches{/branch}","tags_url":"https://api.github.com/repos/google/xi-editor/tags","blobs_url":"https://api.github.com/repos/google/xi-editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/xi-editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/xi-editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/xi-editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/xi-editor/statuses/{sha}","languages_url":"https://api.github.com/repos/google/xi-editor/languages","stargazers_url":"https://api.github.com/repos/google/xi-editor/stargazers","contributors_url":"https://api.github.com/repos/google/xi-editor/contributors","subscribers_url":"https://api.github.com/repos/google/xi-editor/subscribers","subscription_url":"https://api.github.com/repos/google/xi-editor/subscription","commits_url":"https://api.github.com/repos/google/xi-editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/xi-editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/xi-editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/xi-editor/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/xi-editor/contents/{+path}","compare_url":"https://api.github.com/repos/google/xi-editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/xi-editor/merges","archive_url":"https://api.github.com/repos/google/xi-editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/xi-editor/downloads","issues_url":"https://api.github.com/repos/google/xi-editor/issues{/number}","pulls_url":"https://api.github.com/repos/google/xi-editor/pulls{/number}","milestones_url":"https://api.github.com/repos/google/xi-editor/milestones{/number}","notifications_url":"https://api.github.com/repos/google/xi-editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/xi-editor/labels{/name}","releases_url":"https://api.github.com/repos/google/xi-editor/releases{/id}","deployments_url":"https://api.github.com/repos/google/xi-editor/deployments","created_at":"2016-04-26T23:03:23Z","updated_at":"2016-07-25T07:32:09Z","pushed_at":"2016-07-25T10:43:20Z","git_url":"git://github.com/google/xi-editor.git","ssh_url":"git@github.com:google/xi-editor.git","clone_url":"https://github.com/google/xi-editor.git","svn_url":"https://github.com/google/xi-editor","homepage":"","size":955,"stargazers_count":5025,"watchers_count":5025,"language":"Rust","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":157,"mirror_url":null,"open_issues_count":34,"forks":157,"open_issues":34,"watchers":5025,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/xi-editor/pulls/104"},"html":{"href":"https://github.com/google/xi-editor/pull/104"},"issue":{"href":"https://api.github.com/repos/google/xi-editor/issues/104"},"comments":{"href":"https://api.github.com/repos/google/xi-editor/issues/104/comments"},"review_comments":{"href":"https://api.github.com/repos/google/xi-editor/pulls/104/comments"},"review_comment":{"href":"https://api.github.com/repos/google/xi-editor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/xi-editor/pulls/104/commits"},"statuses":{"href":"https://api.github.com/repos/google/xi-editor/statuses/f8d56f6f11e841439bbae93d9f13856b5fa1411d"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":3,"additions":94,"deletions":65,"changed_files":5}}
{"actor":{"display_login":"rkusa"}}