{"action":"created","comment":{"url":"https://api.github.com/repos/JetBrains/jetpad-projectional/pulls/comments/57735465","id":57735465,"diff_hunk":"@@ -0,0 +1,123 @@\n+/*\n+ * Copyright 2012-2016 JetBrains s.r.o\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package jetbrains.jetpad.event;\n+\n+import java.util.Iterator;\n+import java.util.NoSuchElementException;\n+\n+public class TextContentHelper {\n+  private static final char CR = '\\r';\n+  private static final char LF = '\\n';","path":"event/src/main/java/jetbrains/jetpad/event/TextContentHelper.java","position":23,"original_position":23,"commit_id":"3f9e5e1028071f18d2f2b64dca24667369a65af7","original_commit_id":"3f9e5e1028071f18d2f2b64dca24667369a65af7","user":{"login":"aleksei-berezkin","id":16083785,"avatar_url":"https://avatars.githubusercontent.com/u/16083785?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksei-berezkin","html_url":"https://github.com/aleksei-berezkin","followers_url":"https://api.github.com/users/aleksei-berezkin/followers","following_url":"https://api.github.com/users/aleksei-berezkin/following{/other_user}","gists_url":"https://api.github.com/users/aleksei-berezkin/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksei-berezkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksei-berezkin/subscriptions","organizations_url":"https://api.github.com/users/aleksei-berezkin/orgs","repos_url":"https://api.github.com/users/aleksei-berezkin/repos","events_url":"https://api.github.com/users/aleksei-berezkin/events{/privacy}","received_events_url":"https://api.github.com/users/aleksei-berezkin/received_events","type":"User","site_admin":false},"body":"That's carriage return, sometimes used on Win systems and some network protocols. We won't use this as separator but it would be nice to recognize it as part of newline sequence.","created_at":"2016-03-29T14:45:29Z","updated_at":"2016-03-29T14:45:29Z","html_url":"https://github.com/JetBrains/jetpad-projectional/pull/190#discussion_r57735465","pull_request_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/pulls/190","_links":{"self":{"href":"https://api.github.com/repos/JetBrains/jetpad-projectional/pulls/comments/57735465"},"html":{"href":"https://github.com/JetBrains/jetpad-projectional/pull/190#discussion_r57735465"},"pull_request":{"href":"https://api.github.com/repos/JetBrains/jetpad-projectional/pulls/190"}}},"pull_request":{"url":"https://api.github.com/repos/JetBrains/jetpad-projectional/pulls/190","id":64427089,"html_url":"https://github.com/JetBrains/jetpad-projectional/pull/190","diff_url":"https://github.com/JetBrains/jetpad-projectional/pull/190.diff","patch_url":"https://github.com/JetBrains/jetpad-projectional/pull/190.patch","issue_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/issues/190","number":190,"state":"closed","locked":false,"title":"Projectional synchronizer can support ClipboardContents of different kinds","user":{"login":"aleksei-berezkin","id":16083785,"avatar_url":"https://avatars.githubusercontent.com/u/16083785?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksei-berezkin","html_url":"https://github.com/aleksei-berezkin","followers_url":"https://api.github.com/users/aleksei-berezkin/followers","following_url":"https://api.github.com/users/aleksei-berezkin/following{/other_user}","gists_url":"https://api.github.com/users/aleksei-berezkin/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksei-berezkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksei-berezkin/subscriptions","organizations_url":"https://api.github.com/users/aleksei-berezkin/orgs","repos_url":"https://api.github.com/users/aleksei-berezkin/repos","events_url":"https://api.github.com/users/aleksei-berezkin/events{/privacy}","received_events_url":"https://api.github.com/users/aleksei-berezkin/received_events","type":"User","site_admin":false},"body":"NB: there is dependent pull request https://github.com/JetBrains/datapad/pull/11 which must be merged immediately after this. If you like both, please make sure I'm online and ready, then accept both.\r\n\r\nChanges since https://github.com/JetBrains/jetpad-projectional/pull/185\r\n* All naming and messaging recommendations accepted\r\n* Introduced new content kind: `MULTILINE_TEXT`. There is also `ANY_TEXT` content kind for controllers convenience (see usages).\r\n* In `BaseProjectionalSynchronizer`: from-content and to-content concepts are separated because in fact they don't depend on each other. Editor can support pasting from several content kinds and not support generating text, why not. Also, coupling text-generation with some clipboard content kind seems unnecessary. Consequently, content-kind-mappers are gone: to support different content kind client must provide only from-content function.","created_at":"2016-03-29T08:02:54Z","updated_at":"2016-03-29T14:45:29Z","closed_at":"2016-03-29T14:38:52Z","merged_at":"2016-03-29T14:38:52Z","merge_commit_sha":"c758c6d607e4926c5e22b4c92cbffa67d99ada3d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/pulls/190/commits","review_comments_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/pulls/190/comments","review_comment_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/issues/190/comments","statuses_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/statuses/3f9e5e1028071f18d2f2b64dca24667369a65af7","head":{"label":"aleksei-berezkin:projectional-supports-other-content-kinds","ref":"projectional-supports-other-content-kinds","sha":"3f9e5e1028071f18d2f2b64dca24667369a65af7","user":{"login":"aleksei-berezkin","id":16083785,"avatar_url":"https://avatars.githubusercontent.com/u/16083785?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksei-berezkin","html_url":"https://github.com/aleksei-berezkin","followers_url":"https://api.github.com/users/aleksei-berezkin/followers","following_url":"https://api.github.com/users/aleksei-berezkin/following{/other_user}","gists_url":"https://api.github.com/users/aleksei-berezkin/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksei-berezkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksei-berezkin/subscriptions","organizations_url":"https://api.github.com/users/aleksei-berezkin/orgs","repos_url":"https://api.github.com/users/aleksei-berezkin/repos","events_url":"https://api.github.com/users/aleksei-berezkin/events{/privacy}","received_events_url":"https://api.github.com/users/aleksei-berezkin/received_events","type":"User","site_admin":false},"repo":{"id":53087078,"name":"jetpad-projectional","full_name":"aleksei-berezkin/jetpad-projectional","owner":{"login":"aleksei-berezkin","id":16083785,"avatar_url":"https://avatars.githubusercontent.com/u/16083785?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksei-berezkin","html_url":"https://github.com/aleksei-berezkin","followers_url":"https://api.github.com/users/aleksei-berezkin/followers","following_url":"https://api.github.com/users/aleksei-berezkin/following{/other_user}","gists_url":"https://api.github.com/users/aleksei-berezkin/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksei-berezkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksei-berezkin/subscriptions","organizations_url":"https://api.github.com/users/aleksei-berezkin/orgs","repos_url":"https://api.github.com/users/aleksei-berezkin/repos","events_url":"https://api.github.com/users/aleksei-berezkin/events{/privacy}","received_events_url":"https://api.github.com/users/aleksei-berezkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aleksei-berezkin/jetpad-projectional","description":"jetpad-projectional","fork":true,"url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional","forks_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/forks","keys_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/teams","hooks_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/hooks","issue_events_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/issues/events{/number}","events_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/events","assignees_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/assignees{/user}","branches_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/branches{/branch}","tags_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/tags","blobs_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/git/refs{/sha}","trees_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/statuses/{sha}","languages_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/languages","stargazers_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/stargazers","contributors_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/contributors","subscribers_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/subscribers","subscription_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/subscription","commits_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/commits{/sha}","git_commits_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/git/commits{/sha}","comments_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/comments{/number}","issue_comment_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/issues/comments{/number}","contents_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/contents/{+path}","compare_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/merges","archive_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/downloads","issues_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/issues{/number}","pulls_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/pulls{/number}","milestones_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/milestones{/number}","notifications_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/labels{/name}","releases_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/releases{/id}","deployments_url":"https://api.github.com/repos/aleksei-berezkin/jetpad-projectional/deployments","created_at":"2016-03-03T21:55:19Z","updated_at":"2016-03-03T21:55:21Z","pushed_at":"2016-03-29T07:54:24Z","git_url":"git://github.com/aleksei-berezkin/jetpad-projectional.git","ssh_url":"git@github.com:aleksei-berezkin/jetpad-projectional.git","clone_url":"https://github.com/aleksei-berezkin/jetpad-projectional.git","svn_url":"https://github.com/aleksei-berezkin/jetpad-projectional","homepage":null,"size":4051,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"JetBrains:master","ref":"master","sha":"fdf00fc100f20ec60bcc59d0d4895d8bf099fa7f","user":{"login":"JetBrains","id":878437,"avatar_url":"https://avatars.githubusercontent.com/u/878437?v=3","gravatar_id":"","url":"https://api.github.com/users/JetBrains","html_url":"https://github.com/JetBrains","followers_url":"https://api.github.com/users/JetBrains/followers","following_url":"https://api.github.com/users/JetBrains/following{/other_user}","gists_url":"https://api.github.com/users/JetBrains/gists{/gist_id}","starred_url":"https://api.github.com/users/JetBrains/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JetBrains/subscriptions","organizations_url":"https://api.github.com/users/JetBrains/orgs","repos_url":"https://api.github.com/users/JetBrains/repos","events_url":"https://api.github.com/users/JetBrains/events{/privacy}","received_events_url":"https://api.github.com/users/JetBrains/received_events","type":"Organization","site_admin":false},"repo":{"id":14996402,"name":"jetpad-projectional","full_name":"JetBrains/jetpad-projectional","owner":{"login":"JetBrains","id":878437,"avatar_url":"https://avatars.githubusercontent.com/u/878437?v=3","gravatar_id":"","url":"https://api.github.com/users/JetBrains","html_url":"https://github.com/JetBrains","followers_url":"https://api.github.com/users/JetBrains/followers","following_url":"https://api.github.com/users/JetBrains/following{/other_user}","gists_url":"https://api.github.com/users/JetBrains/gists{/gist_id}","starred_url":"https://api.github.com/users/JetBrains/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JetBrains/subscriptions","organizations_url":"https://api.github.com/users/JetBrains/orgs","repos_url":"https://api.github.com/users/JetBrains/repos","events_url":"https://api.github.com/users/JetBrains/events{/privacy}","received_events_url":"https://api.github.com/users/JetBrains/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JetBrains/jetpad-projectional","description":"jetpad-projectional","fork":false,"url":"https://api.github.com/repos/JetBrains/jetpad-projectional","forks_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/forks","keys_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/teams","hooks_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/hooks","issue_events_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/issues/events{/number}","events_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/events","assignees_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/assignees{/user}","branches_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/branches{/branch}","tags_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/tags","blobs_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/git/refs{/sha}","trees_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/statuses/{sha}","languages_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/languages","stargazers_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/stargazers","contributors_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/contributors","subscribers_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/subscribers","subscription_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/subscription","commits_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/commits{/sha}","git_commits_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/git/commits{/sha}","comments_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/comments{/number}","issue_comment_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/issues/comments{/number}","contents_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/contents/{+path}","compare_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/merges","archive_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/downloads","issues_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/issues{/number}","pulls_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/pulls{/number}","milestones_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/milestones{/number}","notifications_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/labels{/name}","releases_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/releases{/id}","deployments_url":"https://api.github.com/repos/JetBrains/jetpad-projectional/deployments","created_at":"2013-12-06T23:45:06Z","updated_at":"2016-03-23T09:18:42Z","pushed_at":"2016-03-29T14:45:27Z","git_url":"git://github.com/JetBrains/jetpad-projectional.git","ssh_url":"git@github.com:JetBrains/jetpad-projectional.git","clone_url":"https://github.com/JetBrains/jetpad-projectional.git","svn_url":"https://github.com/JetBrains/jetpad-projectional","homepage":null,"size":4170,"stargazers_count":61,"watchers_count":61,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":4,"forks":13,"open_issues":4,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JetBrains/jetpad-projectional/pulls/190"},"html":{"href":"https://github.com/JetBrains/jetpad-projectional/pull/190"},"issue":{"href":"https://api.github.com/repos/JetBrains/jetpad-projectional/issues/190"},"comments":{"href":"https://api.github.com/repos/JetBrains/jetpad-projectional/issues/190/comments"},"review_comments":{"href":"https://api.github.com/repos/JetBrains/jetpad-projectional/pulls/190/comments"},"review_comment":{"href":"https://api.github.com/repos/JetBrains/jetpad-projectional/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JetBrains/jetpad-projectional/pulls/190/commits"},"statuses":{"href":"https://api.github.com/repos/JetBrains/jetpad-projectional/statuses/3f9e5e1028071f18d2f2b64dca24667369a65af7"}}}}