{"action":"created","comment":{"url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/comments/50201658","id":50201658,"diff_hunk":"@@ -89,6 +89,43 @@ function! s:get_last_selected() abort\n   endif\n endfunction\n \n+function! s:read_content(content, ...) abort\n+  let tempfile = get(a:000, 0, tempname())\n+  try\n+    call writefile(a:content, tempfile, 'b')\n+    execute printf('keepalt keepjumps read %s', shellescape(tempfile))\n+  finally\n+    call delete(tempfile)\n+  endtry\n+endfunction\n+\n+function! s:edit_content(content, ...) abort\n+  let saved_view = winsaveview()\n+  let saved_modifiable = &l:modifiable","path":"autoload/vital/__latest__/Vim/Buffer.vim","position":16,"original_position":16,"commit_id":"6f1e0b4daaec16e0d56f545da577430e5a3a4060","original_commit_id":"6f1e0b4daaec16e0d56f545da577430e5a3a4060","user":{"login":"thinca","id":20474,"avatar_url":"https://avatars.githubusercontent.com/u/20474?v=3","gravatar_id":"","url":"https://api.github.com/users/thinca","html_url":"https://github.com/thinca","followers_url":"https://api.github.com/users/thinca/followers","following_url":"https://api.github.com/users/thinca/following{/other_user}","gists_url":"https://api.github.com/users/thinca/gists{/gist_id}","starred_url":"https://api.github.com/users/thinca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thinca/subscriptions","organizations_url":"https://api.github.com/users/thinca/orgs","repos_url":"https://api.github.com/users/thinca/repos","events_url":"https://api.github.com/users/thinca/events{/privacy}","received_events_url":"https://api.github.com/users/thinca/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2016-01-20T01:01:38Z","updated_at":"2016-01-20T01:01:38Z","html_url":"https://github.com/vim-jp/vital.vim/pull/378#discussion_r50201658","pull_request_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/378","_links":{"self":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/comments/50201658"},"html":{"href":"https://github.com/vim-jp/vital.vim/pull/378#discussion_r50201658"},"pull_request":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/378"}}},"pull_request":{"url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/378","id":56549409,"html_url":"https://github.com/vim-jp/vital.vim/pull/378","diff_url":"https://github.com/vim-jp/vital.vim/pull/378.diff","patch_url":"https://github.com/vim-jp/vital.vim/pull/378.patch","issue_url":"https://api.github.com/repos/vim-jp/vital.vim/issues/378","number":378,"state":"open","locked":false,"title":"[WIP] Vim.Buffer: Add read_content, edit_content, wipeout_all methods","user":{"login":"lambdalisue","id":546312,"avatar_url":"https://avatars.githubusercontent.com/u/546312?v=3","gravatar_id":"","url":"https://api.github.com/users/lambdalisue","html_url":"https://github.com/lambdalisue","followers_url":"https://api.github.com/users/lambdalisue/followers","following_url":"https://api.github.com/users/lambdalisue/following{/other_user}","gists_url":"https://api.github.com/users/lambdalisue/gists{/gist_id}","starred_url":"https://api.github.com/users/lambdalisue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lambdalisue/subscriptions","organizations_url":"https://api.github.com/users/lambdalisue/orgs","repos_url":"https://api.github.com/users/lambdalisue/repos","events_url":"https://api.github.com/users/lambdalisue/events{/privacy}","received_events_url":"https://api.github.com/users/lambdalisue/received_events","type":"User","site_admin":false},"body":"### `read_content`, `edit_content`\r\n\r\n文字コード不明のコンテンツ（stdout の結果や HTTP の結果など）を一時ファイルに保存し `read` にて読み込むことでいい感じに読めるようにする。\r\nhttps://gist.github.com/lambdalisue/16414ff40d5338d93dd3\r\n\r\n### `wipeout_all`\r\n\r\nバッファ編集関係のプラグインを書いている際に themis の `Before` などで全バッファをとりあえず削除したい時などに便利。古い Vim だと `bwipeout!` だけじゃダメだったので\r\n\r\nヘルプは後ほど","created_at":"2016-01-20T00:49:26Z","updated_at":"2016-01-20T01:01:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4012ae48d675692887f938b4c9d47dcb33f34451","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/378/commits","review_comments_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/378/comments","review_comment_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vim-jp/vital.vim/issues/378/comments","statuses_url":"https://api.github.com/repos/vim-jp/vital.vim/statuses/6f1e0b4daaec16e0d56f545da577430e5a3a4060","head":{"label":"lambdalisue:improve/Vim-Buffer","ref":"improve/Vim-Buffer","sha":"6f1e0b4daaec16e0d56f545da577430e5a3a4060","user":{"login":"lambdalisue","id":546312,"avatar_url":"https://avatars.githubusercontent.com/u/546312?v=3","gravatar_id":"","url":"https://api.github.com/users/lambdalisue","html_url":"https://github.com/lambdalisue","followers_url":"https://api.github.com/users/lambdalisue/followers","following_url":"https://api.github.com/users/lambdalisue/following{/other_user}","gists_url":"https://api.github.com/users/lambdalisue/gists{/gist_id}","starred_url":"https://api.github.com/users/lambdalisue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lambdalisue/subscriptions","organizations_url":"https://api.github.com/users/lambdalisue/orgs","repos_url":"https://api.github.com/users/lambdalisue/repos","events_url":"https://api.github.com/users/lambdalisue/events{/privacy}","received_events_url":"https://api.github.com/users/lambdalisue/received_events","type":"User","site_admin":false},"repo":{"id":20846889,"name":"vital.vim","full_name":"lambdalisue/vital.vim","owner":{"login":"lambdalisue","id":546312,"avatar_url":"https://avatars.githubusercontent.com/u/546312?v=3","gravatar_id":"","url":"https://api.github.com/users/lambdalisue","html_url":"https://github.com/lambdalisue","followers_url":"https://api.github.com/users/lambdalisue/followers","following_url":"https://api.github.com/users/lambdalisue/following{/other_user}","gists_url":"https://api.github.com/users/lambdalisue/gists{/gist_id}","starred_url":"https://api.github.com/users/lambdalisue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lambdalisue/subscriptions","organizations_url":"https://api.github.com/users/lambdalisue/orgs","repos_url":"https://api.github.com/users/lambdalisue/repos","events_url":"https://api.github.com/users/lambdalisue/events{/privacy}","received_events_url":"https://api.github.com/users/lambdalisue/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lambdalisue/vital.vim","description":"A comprehensive Vim utility functions for Vim plugins","fork":true,"url":"https://api.github.com/repos/lambdalisue/vital.vim","forks_url":"https://api.github.com/repos/lambdalisue/vital.vim/forks","keys_url":"https://api.github.com/repos/lambdalisue/vital.vim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lambdalisue/vital.vim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lambdalisue/vital.vim/teams","hooks_url":"https://api.github.com/repos/lambdalisue/vital.vim/hooks","issue_events_url":"https://api.github.com/repos/lambdalisue/vital.vim/issues/events{/number}","events_url":"https://api.github.com/repos/lambdalisue/vital.vim/events","assignees_url":"https://api.github.com/repos/lambdalisue/vital.vim/assignees{/user}","branches_url":"https://api.github.com/repos/lambdalisue/vital.vim/branches{/branch}","tags_url":"https://api.github.com/repos/lambdalisue/vital.vim/tags","blobs_url":"https://api.github.com/repos/lambdalisue/vital.vim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lambdalisue/vital.vim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lambdalisue/vital.vim/git/refs{/sha}","trees_url":"https://api.github.com/repos/lambdalisue/vital.vim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lambdalisue/vital.vim/statuses/{sha}","languages_url":"https://api.github.com/repos/lambdalisue/vital.vim/languages","stargazers_url":"https://api.github.com/repos/lambdalisue/vital.vim/stargazers","contributors_url":"https://api.github.com/repos/lambdalisue/vital.vim/contributors","subscribers_url":"https://api.github.com/repos/lambdalisue/vital.vim/subscribers","subscription_url":"https://api.github.com/repos/lambdalisue/vital.vim/subscription","commits_url":"https://api.github.com/repos/lambdalisue/vital.vim/commits{/sha}","git_commits_url":"https://api.github.com/repos/lambdalisue/vital.vim/git/commits{/sha}","comments_url":"https://api.github.com/repos/lambdalisue/vital.vim/comments{/number}","issue_comment_url":"https://api.github.com/repos/lambdalisue/vital.vim/issues/comments{/number}","contents_url":"https://api.github.com/repos/lambdalisue/vital.vim/contents/{+path}","compare_url":"https://api.github.com/repos/lambdalisue/vital.vim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lambdalisue/vital.vim/merges","archive_url":"https://api.github.com/repos/lambdalisue/vital.vim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lambdalisue/vital.vim/downloads","issues_url":"https://api.github.com/repos/lambdalisue/vital.vim/issues{/number}","pulls_url":"https://api.github.com/repos/lambdalisue/vital.vim/pulls{/number}","milestones_url":"https://api.github.com/repos/lambdalisue/vital.vim/milestones{/number}","notifications_url":"https://api.github.com/repos/lambdalisue/vital.vim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lambdalisue/vital.vim/labels{/name}","releases_url":"https://api.github.com/repos/lambdalisue/vital.vim/releases{/id}","created_at":"2014-06-15T02:59:01Z","updated_at":"2015-04-29T04:22:51Z","pushed_at":"2016-01-20T00:46:17Z","git_url":"git://github.com/lambdalisue/vital.vim.git","ssh_url":"git@github.com:lambdalisue/vital.vim.git","clone_url":"https://github.com/lambdalisue/vital.vim.git","svn_url":"https://github.com/lambdalisue/vital.vim","homepage":"","size":2453,"stargazers_count":0,"watchers_count":0,"language":"VimL","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":"vim-jp:master","ref":"master","sha":"e0ecbbd009100e9403f328a8cd1d950d6530ee3d","user":{"login":"vim-jp","id":1051958,"avatar_url":"https://avatars.githubusercontent.com/u/1051958?v=3","gravatar_id":"","url":"https://api.github.com/users/vim-jp","html_url":"https://github.com/vim-jp","followers_url":"https://api.github.com/users/vim-jp/followers","following_url":"https://api.github.com/users/vim-jp/following{/other_user}","gists_url":"https://api.github.com/users/vim-jp/gists{/gist_id}","starred_url":"https://api.github.com/users/vim-jp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vim-jp/subscriptions","organizations_url":"https://api.github.com/users/vim-jp/orgs","repos_url":"https://api.github.com/users/vim-jp/repos","events_url":"https://api.github.com/users/vim-jp/events{/privacy}","received_events_url":"https://api.github.com/users/vim-jp/received_events","type":"Organization","site_admin":false},"repo":{"id":1308435,"name":"vital.vim","full_name":"vim-jp/vital.vim","owner":{"login":"vim-jp","id":1051958,"avatar_url":"https://avatars.githubusercontent.com/u/1051958?v=3","gravatar_id":"","url":"https://api.github.com/users/vim-jp","html_url":"https://github.com/vim-jp","followers_url":"https://api.github.com/users/vim-jp/followers","following_url":"https://api.github.com/users/vim-jp/following{/other_user}","gists_url":"https://api.github.com/users/vim-jp/gists{/gist_id}","starred_url":"https://api.github.com/users/vim-jp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vim-jp/subscriptions","organizations_url":"https://api.github.com/users/vim-jp/orgs","repos_url":"https://api.github.com/users/vim-jp/repos","events_url":"https://api.github.com/users/vim-jp/events{/privacy}","received_events_url":"https://api.github.com/users/vim-jp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vim-jp/vital.vim","description":"A comprehensive Vim utility functions for Vim plugins","fork":false,"url":"https://api.github.com/repos/vim-jp/vital.vim","forks_url":"https://api.github.com/repos/vim-jp/vital.vim/forks","keys_url":"https://api.github.com/repos/vim-jp/vital.vim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vim-jp/vital.vim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vim-jp/vital.vim/teams","hooks_url":"https://api.github.com/repos/vim-jp/vital.vim/hooks","issue_events_url":"https://api.github.com/repos/vim-jp/vital.vim/issues/events{/number}","events_url":"https://api.github.com/repos/vim-jp/vital.vim/events","assignees_url":"https://api.github.com/repos/vim-jp/vital.vim/assignees{/user}","branches_url":"https://api.github.com/repos/vim-jp/vital.vim/branches{/branch}","tags_url":"https://api.github.com/repos/vim-jp/vital.vim/tags","blobs_url":"https://api.github.com/repos/vim-jp/vital.vim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vim-jp/vital.vim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vim-jp/vital.vim/git/refs{/sha}","trees_url":"https://api.github.com/repos/vim-jp/vital.vim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vim-jp/vital.vim/statuses/{sha}","languages_url":"https://api.github.com/repos/vim-jp/vital.vim/languages","stargazers_url":"https://api.github.com/repos/vim-jp/vital.vim/stargazers","contributors_url":"https://api.github.com/repos/vim-jp/vital.vim/contributors","subscribers_url":"https://api.github.com/repos/vim-jp/vital.vim/subscribers","subscription_url":"https://api.github.com/repos/vim-jp/vital.vim/subscription","commits_url":"https://api.github.com/repos/vim-jp/vital.vim/commits{/sha}","git_commits_url":"https://api.github.com/repos/vim-jp/vital.vim/git/commits{/sha}","comments_url":"https://api.github.com/repos/vim-jp/vital.vim/comments{/number}","issue_comment_url":"https://api.github.com/repos/vim-jp/vital.vim/issues/comments{/number}","contents_url":"https://api.github.com/repos/vim-jp/vital.vim/contents/{+path}","compare_url":"https://api.github.com/repos/vim-jp/vital.vim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vim-jp/vital.vim/merges","archive_url":"https://api.github.com/repos/vim-jp/vital.vim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vim-jp/vital.vim/downloads","issues_url":"https://api.github.com/repos/vim-jp/vital.vim/issues{/number}","pulls_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls{/number}","milestones_url":"https://api.github.com/repos/vim-jp/vital.vim/milestones{/number}","notifications_url":"https://api.github.com/repos/vim-jp/vital.vim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vim-jp/vital.vim/labels{/name}","releases_url":"https://api.github.com/repos/vim-jp/vital.vim/releases{/id}","created_at":"2011-01-30T08:40:37Z","updated_at":"2016-01-17T22:14:29Z","pushed_at":"2016-01-20T00:49:28Z","git_url":"git://github.com/vim-jp/vital.vim.git","ssh_url":"git@github.com:vim-jp/vital.vim.git","clone_url":"https://github.com/vim-jp/vital.vim.git","svn_url":"https://github.com/vim-jp/vital.vim","homepage":"","size":3366,"stargazers_count":208,"watchers_count":208,"language":"VimL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":45,"forks":39,"open_issues":45,"watchers":208,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/378"},"html":{"href":"https://github.com/vim-jp/vital.vim/pull/378"},"issue":{"href":"https://api.github.com/repos/vim-jp/vital.vim/issues/378"},"comments":{"href":"https://api.github.com/repos/vim-jp/vital.vim/issues/378/comments"},"review_comments":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/378/comments"},"review_comment":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/378/commits"},"statuses":{"href":"https://api.github.com/repos/vim-jp/vital.vim/statuses/6f1e0b4daaec16e0d56f545da577430e5a3a4060"}}}}