{"action":"created","comment":{"url":"https://api.github.com/repos/powerline/powerline/pulls/comments/44837954","id":44837954,"diff_hunk":"@@ -0,0 +1,102 @@\n+# vim:fileencoding=utf-8:noet\n+from __future__ import (unicode_literals, division, absolute_import, print_function)\n+\n+try:\n+\timport vim\n+except ImportError:\n+\tvim = object()\n+\n+from powerline.bindings.vim import create_ruby_dpowerline\n+\n+\n+def initialize():\n+\tglobal initialized\n+\tif initialized:\n+\t\treturn\n+\tinitialized = True\n+\tvim.command('echom 3210')\n+\tvim.command('let g:ctrlp_status = {}')\n+\tvim.command(\n+\t\t'''\n+\t\texecute 'function! Ctrlp_status_main(focus, byfname, regex, prev, item, next, marked)\n+\t\t\tlet g:ctrlp_status = {\\\n+\"focus\": a:focus,\\\n+\"byfname\": a:byfname,\\\n+\"regex\": a:regex,\\\n+\"prev\": a:prev,\\\n+\"item\": a:item,\\\n+\"next\": a:next,\\\n+\"marked\": a:marked,\\\n+}\n+\t\t\treturn \"\"\n+\t\tendfunction'\n+\t\t'''\n+\t)\n+\tvim.command(\n+\t\t'''\n+\t\texecute 'function! Ctrlp_status_prog(str)\n+\t\t\tlet g:ctrlp_status[\"prog\"] = a:str\n+\t\t\treturn \"\"\n+\t\tendfunction'\n+\t\t'''\n+\t)\n+\tvim.command(\n+\t\t'''\n+\t\tlet g:ctrlp_status_func = {\\\n+\t\t\t'main': 'Ctrlp_status_main',\\\n+\t\t\t'prog': 'Ctrlp_status_prog',\\\n+\t\t}\n+\t\t'''\n+\t)\n+\n+initialized = False\n+\n+def marked(pl):\n+\tinitialize()\n+\tstatus = vim.eval('g:ctrlp_status')\n+\tif 'prog' in status:\n+\t\treturn []\n+\treturn None if status['marked'] == ' <->' else [{\n+\t\t'highlight_groups': ['ctrlp:marked'],\n+\t\t'contents': status['marked'].strip()\n+\t}]\n+\n+def mode(pl):\n+\tinitialize()\n+\tstatus = vim.eval('g:ctrlp_status')\n+\tif 'prog' in status:\n+\t\treturn []\n+\treturn [{\n+\t\t'highlight_groups': ['ctrlp:status'],\n+\t\t'contents': ' ' + status['item'] + ' '\n+\t}]\n+\n+def mode_prev(pl):\n+\tinitialize()\n+\tstatus = vim.eval('g:ctrlp_status')\n+\tif 'prog' in status:\n+\t\treturn []\n+\treturn [{\n+\t\t'highlight_groups': ['ctrlp:status_other'],\n+\t\t'contents': status['prev'] + ' '\n+\t}]\n+\n+def mode_next(pl):","path":"powerline/segments/vim/plugin/ctrlp.py","position":84,"original_position":84,"commit_id":"0f92432fec52328cd7e48d0f382a2af309fe6297","original_commit_id":"0f92432fec52328cd7e48d0f382a2af309fe6297","user":{"login":"ZyX-I","id":322097,"avatar_url":"https://avatars.githubusercontent.com/u/322097?v=3","gravatar_id":"","url":"https://api.github.com/users/ZyX-I","html_url":"https://github.com/ZyX-I","followers_url":"https://api.github.com/users/ZyX-I/followers","following_url":"https://api.github.com/users/ZyX-I/following{/other_user}","gists_url":"https://api.github.com/users/ZyX-I/gists{/gist_id}","starred_url":"https://api.github.com/users/ZyX-I/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZyX-I/subscriptions","organizations_url":"https://api.github.com/users/ZyX-I/orgs","repos_url":"https://api.github.com/users/ZyX-I/repos","events_url":"https://api.github.com/users/ZyX-I/events{/privacy}","received_events_url":"https://api.github.com/users/ZyX-I/received_events","type":"User","site_admin":false},"body":"Missing documentation.","created_at":"2015-11-13T21:46:09Z","updated_at":"2015-11-13T21:46:09Z","html_url":"https://github.com/powerline/powerline/pull/1490#discussion_r44837954","pull_request_url":"https://api.github.com/repos/powerline/powerline/pulls/1490","_links":{"self":{"href":"https://api.github.com/repos/powerline/powerline/pulls/comments/44837954"},"html":{"href":"https://github.com/powerline/powerline/pull/1490#discussion_r44837954"},"pull_request":{"href":"https://api.github.com/repos/powerline/powerline/pulls/1490"}}},"pull_request":{"url":"https://api.github.com/repos/powerline/powerline/pulls/1490","id":50686833,"html_url":"https://github.com/powerline/powerline/pull/1490","diff_url":"https://github.com/powerline/powerline/pull/1490.diff","patch_url":"https://github.com/powerline/powerline/pull/1490.patch","issue_url":"https://api.github.com/repos/powerline/powerline/issues/1490","number":1490,"state":"open","locked":false,"title":"ctrlp statusline","user":{"login":"sassanh","id":1270688,"avatar_url":"https://avatars.githubusercontent.com/u/1270688?v=3","gravatar_id":"","url":"https://api.github.com/users/sassanh","html_url":"https://github.com/sassanh","followers_url":"https://api.github.com/users/sassanh/followers","following_url":"https://api.github.com/users/sassanh/following{/other_user}","gists_url":"https://api.github.com/users/sassanh/gists{/gist_id}","starred_url":"https://api.github.com/users/sassanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sassanh/subscriptions","organizations_url":"https://api.github.com/users/sassanh/orgs","repos_url":"https://api.github.com/users/sassanh/repos","events_url":"https://api.github.com/users/sassanh/events{/privacy}","received_events_url":"https://api.github.com/users/sassanh/received_events","type":"User","site_admin":false},"body":"PR for https://github.com/powerline/powerline/issues/1489","created_at":"2015-11-13T20:19:16Z","updated_at":"2015-11-13T21:46:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b793fb5adedbae9f2eaa00455358c24889f85db","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/powerline/powerline/pulls/1490/commits","review_comments_url":"https://api.github.com/repos/powerline/powerline/pulls/1490/comments","review_comment_url":"https://api.github.com/repos/powerline/powerline/pulls/comments{/number}","comments_url":"https://api.github.com/repos/powerline/powerline/issues/1490/comments","statuses_url":"https://api.github.com/repos/powerline/powerline/statuses/0f92432fec52328cd7e48d0f382a2af309fe6297","head":{"label":"sassanh:ctrlp","ref":"ctrlp","sha":"0f92432fec52328cd7e48d0f382a2af309fe6297","user":{"login":"sassanh","id":1270688,"avatar_url":"https://avatars.githubusercontent.com/u/1270688?v=3","gravatar_id":"","url":"https://api.github.com/users/sassanh","html_url":"https://github.com/sassanh","followers_url":"https://api.github.com/users/sassanh/followers","following_url":"https://api.github.com/users/sassanh/following{/other_user}","gists_url":"https://api.github.com/users/sassanh/gists{/gist_id}","starred_url":"https://api.github.com/users/sassanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sassanh/subscriptions","organizations_url":"https://api.github.com/users/sassanh/orgs","repos_url":"https://api.github.com/users/sassanh/repos","events_url":"https://api.github.com/users/sassanh/events{/privacy}","received_events_url":"https://api.github.com/users/sassanh/received_events","type":"User","site_admin":false},"repo":{"id":46144997,"name":"powerline","full_name":"sassanh/powerline","owner":{"login":"sassanh","id":1270688,"avatar_url":"https://avatars.githubusercontent.com/u/1270688?v=3","gravatar_id":"","url":"https://api.github.com/users/sassanh","html_url":"https://github.com/sassanh","followers_url":"https://api.github.com/users/sassanh/followers","following_url":"https://api.github.com/users/sassanh/following{/other_user}","gists_url":"https://api.github.com/users/sassanh/gists{/gist_id}","starred_url":"https://api.github.com/users/sassanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sassanh/subscriptions","organizations_url":"https://api.github.com/users/sassanh/orgs","repos_url":"https://api.github.com/users/sassanh/repos","events_url":"https://api.github.com/users/sassanh/events{/privacy}","received_events_url":"https://api.github.com/users/sassanh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sassanh/powerline","description":"Powerline is a statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome and Qtile.","fork":true,"url":"https://api.github.com/repos/sassanh/powerline","forks_url":"https://api.github.com/repos/sassanh/powerline/forks","keys_url":"https://api.github.com/repos/sassanh/powerline/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sassanh/powerline/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sassanh/powerline/teams","hooks_url":"https://api.github.com/repos/sassanh/powerline/hooks","issue_events_url":"https://api.github.com/repos/sassanh/powerline/issues/events{/number}","events_url":"https://api.github.com/repos/sassanh/powerline/events","assignees_url":"https://api.github.com/repos/sassanh/powerline/assignees{/user}","branches_url":"https://api.github.com/repos/sassanh/powerline/branches{/branch}","tags_url":"https://api.github.com/repos/sassanh/powerline/tags","blobs_url":"https://api.github.com/repos/sassanh/powerline/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sassanh/powerline/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sassanh/powerline/git/refs{/sha}","trees_url":"https://api.github.com/repos/sassanh/powerline/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sassanh/powerline/statuses/{sha}","languages_url":"https://api.github.com/repos/sassanh/powerline/languages","stargazers_url":"https://api.github.com/repos/sassanh/powerline/stargazers","contributors_url":"https://api.github.com/repos/sassanh/powerline/contributors","subscribers_url":"https://api.github.com/repos/sassanh/powerline/subscribers","subscription_url":"https://api.github.com/repos/sassanh/powerline/subscription","commits_url":"https://api.github.com/repos/sassanh/powerline/commits{/sha}","git_commits_url":"https://api.github.com/repos/sassanh/powerline/git/commits{/sha}","comments_url":"https://api.github.com/repos/sassanh/powerline/comments{/number}","issue_comment_url":"https://api.github.com/repos/sassanh/powerline/issues/comments{/number}","contents_url":"https://api.github.com/repos/sassanh/powerline/contents/{+path}","compare_url":"https://api.github.com/repos/sassanh/powerline/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sassanh/powerline/merges","archive_url":"https://api.github.com/repos/sassanh/powerline/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sassanh/powerline/downloads","issues_url":"https://api.github.com/repos/sassanh/powerline/issues{/number}","pulls_url":"https://api.github.com/repos/sassanh/powerline/pulls{/number}","milestones_url":"https://api.github.com/repos/sassanh/powerline/milestones{/number}","notifications_url":"https://api.github.com/repos/sassanh/powerline/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sassanh/powerline/labels{/name}","releases_url":"https://api.github.com/repos/sassanh/powerline/releases{/id}","created_at":"2015-11-13T20:16:49Z","updated_at":"2015-11-13T20:16:51Z","pushed_at":"2015-11-13T20:17:42Z","git_url":"git://github.com/sassanh/powerline.git","ssh_url":"git@github.com:sassanh/powerline.git","clone_url":"https://github.com/sassanh/powerline.git","svn_url":"https://github.com/sassanh/powerline","homepage":"https://powerline.readthedocs.org/en/latest/","size":8832,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"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":"develop"}},"base":{"label":"powerline:develop","ref":"develop","sha":"4e7f39926a02df5e19a3bbb263685f2c6722a4f0","user":{"login":"powerline","id":10100576,"avatar_url":"https://avatars.githubusercontent.com/u/10100576?v=3","gravatar_id":"","url":"https://api.github.com/users/powerline","html_url":"https://github.com/powerline","followers_url":"https://api.github.com/users/powerline/followers","following_url":"https://api.github.com/users/powerline/following{/other_user}","gists_url":"https://api.github.com/users/powerline/gists{/gist_id}","starred_url":"https://api.github.com/users/powerline/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/powerline/subscriptions","organizations_url":"https://api.github.com/users/powerline/orgs","repos_url":"https://api.github.com/users/powerline/repos","events_url":"https://api.github.com/users/powerline/events{/privacy}","received_events_url":"https://api.github.com/users/powerline/received_events","type":"Organization","site_admin":false},"repo":{"id":4637221,"name":"powerline","full_name":"powerline/powerline","owner":{"login":"powerline","id":10100576,"avatar_url":"https://avatars.githubusercontent.com/u/10100576?v=3","gravatar_id":"","url":"https://api.github.com/users/powerline","html_url":"https://github.com/powerline","followers_url":"https://api.github.com/users/powerline/followers","following_url":"https://api.github.com/users/powerline/following{/other_user}","gists_url":"https://api.github.com/users/powerline/gists{/gist_id}","starred_url":"https://api.github.com/users/powerline/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/powerline/subscriptions","organizations_url":"https://api.github.com/users/powerline/orgs","repos_url":"https://api.github.com/users/powerline/repos","events_url":"https://api.github.com/users/powerline/events{/privacy}","received_events_url":"https://api.github.com/users/powerline/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/powerline/powerline","description":"Powerline is a statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome and Qtile.","fork":false,"url":"https://api.github.com/repos/powerline/powerline","forks_url":"https://api.github.com/repos/powerline/powerline/forks","keys_url":"https://api.github.com/repos/powerline/powerline/keys{/key_id}","collaborators_url":"https://api.github.com/repos/powerline/powerline/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/powerline/powerline/teams","hooks_url":"https://api.github.com/repos/powerline/powerline/hooks","issue_events_url":"https://api.github.com/repos/powerline/powerline/issues/events{/number}","events_url":"https://api.github.com/repos/powerline/powerline/events","assignees_url":"https://api.github.com/repos/powerline/powerline/assignees{/user}","branches_url":"https://api.github.com/repos/powerline/powerline/branches{/branch}","tags_url":"https://api.github.com/repos/powerline/powerline/tags","blobs_url":"https://api.github.com/repos/powerline/powerline/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/powerline/powerline/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/powerline/powerline/git/refs{/sha}","trees_url":"https://api.github.com/repos/powerline/powerline/git/trees{/sha}","statuses_url":"https://api.github.com/repos/powerline/powerline/statuses/{sha}","languages_url":"https://api.github.com/repos/powerline/powerline/languages","stargazers_url":"https://api.github.com/repos/powerline/powerline/stargazers","contributors_url":"https://api.github.com/repos/powerline/powerline/contributors","subscribers_url":"https://api.github.com/repos/powerline/powerline/subscribers","subscription_url":"https://api.github.com/repos/powerline/powerline/subscription","commits_url":"https://api.github.com/repos/powerline/powerline/commits{/sha}","git_commits_url":"https://api.github.com/repos/powerline/powerline/git/commits{/sha}","comments_url":"https://api.github.com/repos/powerline/powerline/comments{/number}","issue_comment_url":"https://api.github.com/repos/powerline/powerline/issues/comments{/number}","contents_url":"https://api.github.com/repos/powerline/powerline/contents/{+path}","compare_url":"https://api.github.com/repos/powerline/powerline/compare/{base}...{head}","merges_url":"https://api.github.com/repos/powerline/powerline/merges","archive_url":"https://api.github.com/repos/powerline/powerline/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/powerline/powerline/downloads","issues_url":"https://api.github.com/repos/powerline/powerline/issues{/number}","pulls_url":"https://api.github.com/repos/powerline/powerline/pulls{/number}","milestones_url":"https://api.github.com/repos/powerline/powerline/milestones{/number}","notifications_url":"https://api.github.com/repos/powerline/powerline/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/powerline/powerline/labels{/name}","releases_url":"https://api.github.com/repos/powerline/powerline/releases{/id}","created_at":"2012-06-12T12:48:40Z","updated_at":"2015-11-13T17:05:19Z","pushed_at":"2015-11-13T20:19:16Z","git_url":"git://github.com/powerline/powerline.git","ssh_url":"git@github.com:powerline/powerline.git","clone_url":"https://github.com/powerline/powerline.git","svn_url":"https://github.com/powerline/powerline","homepage":"https://powerline.readthedocs.org/en/latest/","size":8832,"stargazers_count":4982,"watchers_count":4982,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":442,"mirror_url":null,"open_issues_count":55,"forks":442,"open_issues":55,"watchers":4982,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/powerline/powerline/pulls/1490"},"html":{"href":"https://github.com/powerline/powerline/pull/1490"},"issue":{"href":"https://api.github.com/repos/powerline/powerline/issues/1490"},"comments":{"href":"https://api.github.com/repos/powerline/powerline/issues/1490/comments"},"review_comments":{"href":"https://api.github.com/repos/powerline/powerline/pulls/1490/comments"},"review_comment":{"href":"https://api.github.com/repos/powerline/powerline/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/powerline/powerline/pulls/1490/commits"},"statuses":{"href":"https://api.github.com/repos/powerline/powerline/statuses/0f92432fec52328cd7e48d0f382a2af309fe6297"}}}}