{"action":"created","comment":{"url":"https://api.github.com/repos/nathangrigg/vim-beancount/pulls/comments/30809343","id":30809343,"diff_hunk":"@@ -56,14 +66,29 @@ function! beancount#complete_account(findstart, base)\n         endif\n         let b:beancount_accounts = beancount#find_accounts(l:root)\n     endif\n-    let l:pattern = '\\V' . substitute(a:base, \":\", '\\\\S\\\\*:\\\\S\\\\*', \"g\")\n+\n+    if g:beancount_account_completion ==? 'chunks'\n+        let l:pattern = '\\V' . substitute(a:base, \":\", '\\\\[^ \\\\t:]\\\\*:', \"g\") . '\\[^ \\t:]\\*'\n+    else\n+        let l:pattern = '\\V' . substitute(a:base, \":\", '\\\\S\\\\*:\\\\S\\\\*', \"g\")\n+    endif\n+\n     let l:matches = []\n     let l:index = -1\n     while 1\n         let l:index = match(b:beancount_accounts, l:pattern, l:index + 1)\n         if l:index == -1 | break | endif\n-        call add(l:matches, b:beancount_accounts[l:index])\n+        if g:beancount_account_completion ==? 'chunks'\n+            call add(l:matches, matchstr(b:beancount_accounts[l:index], l:pattern))","path":"autoload/beancount.vim","position":36,"original_position":36,"commit_id":"8fbe86e0f0bf9948ef8d626b147c22a3b88f335b","original_commit_id":"8fbe86e0f0bf9948ef8d626b147c22a3b88f335b","user":{"login":"nathangrigg","id":896960,"avatar_url":"https://avatars.githubusercontent.com/u/896960?v=3","gravatar_id":"","url":"https://api.github.com/users/nathangrigg","html_url":"https://github.com/nathangrigg","followers_url":"https://api.github.com/users/nathangrigg/followers","following_url":"https://api.github.com/users/nathangrigg/following{/other_user}","gists_url":"https://api.github.com/users/nathangrigg/gists{/gist_id}","starred_url":"https://api.github.com/users/nathangrigg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathangrigg/subscriptions","organizations_url":"https://api.github.com/users/nathangrigg/orgs","repos_url":"https://api.github.com/users/nathangrigg/repos","events_url":"https://api.github.com/users/nathangrigg/events{/privacy}","received_events_url":"https://api.github.com/users/nathangrigg/received_events","type":"User","site_admin":false},"body":"By appending `\\.\\*` to the regular expression in the default case, you can use this branch every time and avoid the extra if statement.","created_at":"2015-05-21T14:48:08Z","updated_at":"2015-05-21T14:48:08Z","html_url":"https://github.com/nathangrigg/vim-beancount/pull/7#discussion_r30809343","pull_request_url":"https://api.github.com/repos/nathangrigg/vim-beancount/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/nathangrigg/vim-beancount/pulls/comments/30809343"},"html":{"href":"https://github.com/nathangrigg/vim-beancount/pull/7#discussion_r30809343"},"pull_request":{"href":"https://api.github.com/repos/nathangrigg/vim-beancount/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/nathangrigg/vim-beancount/pulls/7","id":35920935,"html_url":"https://github.com/nathangrigg/vim-beancount/pull/7","diff_url":"https://github.com/nathangrigg/vim-beancount/pull/7.diff","patch_url":"https://github.com/nathangrigg/vim-beancount/pull/7.patch","issue_url":"https://api.github.com/repos/nathangrigg/vim-beancount/issues/7","number":7,"state":"open","locked":false,"title":"add vim-ledger style completion as an option","user":{"login":"kljohann","id":67211,"avatar_url":"https://avatars.githubusercontent.com/u/67211?v=3","gravatar_id":"","url":"https://api.github.com/users/kljohann","html_url":"https://github.com/kljohann","followers_url":"https://api.github.com/users/kljohann/followers","following_url":"https://api.github.com/users/kljohann/following{/other_user}","gists_url":"https://api.github.com/users/kljohann/gists{/gist_id}","starred_url":"https://api.github.com/users/kljohann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kljohann/subscriptions","organizations_url":"https://api.github.com/users/kljohann/orgs","repos_url":"https://api.github.com/users/kljohann/repos","events_url":"https://api.github.com/users/kljohann/events{/privacy}","received_events_url":"https://api.github.com/users/kljohann/received_events","type":"User","site_admin":false},"body":"As I'm toying around with beancount at the moment, I began to miss the colon-anchored completion implemented in vim-ledger. Feel free to propose a better name for the option (instead of `chunks`) or pick away at the implementation :)","created_at":"2015-05-21T10:42:06Z","updated_at":"2015-05-21T14:48:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"383e8612771faa2efce2771ea658a4e242f18bb8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nathangrigg/vim-beancount/pulls/7/commits","review_comments_url":"https://api.github.com/repos/nathangrigg/vim-beancount/pulls/7/comments","review_comment_url":"https://api.github.com/repos/nathangrigg/vim-beancount/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nathangrigg/vim-beancount/issues/7/comments","statuses_url":"https://api.github.com/repos/nathangrigg/vim-beancount/statuses/8fbe86e0f0bf9948ef8d626b147c22a3b88f335b","head":{"label":"kljohann:completion","ref":"completion","sha":"8fbe86e0f0bf9948ef8d626b147c22a3b88f335b","user":{"login":"kljohann","id":67211,"avatar_url":"https://avatars.githubusercontent.com/u/67211?v=3","gravatar_id":"","url":"https://api.github.com/users/kljohann","html_url":"https://github.com/kljohann","followers_url":"https://api.github.com/users/kljohann/followers","following_url":"https://api.github.com/users/kljohann/following{/other_user}","gists_url":"https://api.github.com/users/kljohann/gists{/gist_id}","starred_url":"https://api.github.com/users/kljohann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kljohann/subscriptions","organizations_url":"https://api.github.com/users/kljohann/orgs","repos_url":"https://api.github.com/users/kljohann/repos","events_url":"https://api.github.com/users/kljohann/events{/privacy}","received_events_url":"https://api.github.com/users/kljohann/received_events","type":"User","site_admin":false},"repo":{"id":28923140,"name":"vim-beancount","full_name":"kljohann/vim-beancount","owner":{"login":"kljohann","id":67211,"avatar_url":"https://avatars.githubusercontent.com/u/67211?v=3","gravatar_id":"","url":"https://api.github.com/users/kljohann","html_url":"https://github.com/kljohann","followers_url":"https://api.github.com/users/kljohann/followers","following_url":"https://api.github.com/users/kljohann/following{/other_user}","gists_url":"https://api.github.com/users/kljohann/gists{/gist_id}","starred_url":"https://api.github.com/users/kljohann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kljohann/subscriptions","organizations_url":"https://api.github.com/users/kljohann/orgs","repos_url":"https://api.github.com/users/kljohann/repos","events_url":"https://api.github.com/users/kljohann/events{/privacy}","received_events_url":"https://api.github.com/users/kljohann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kljohann/vim-beancount","description":"Vim ftplugin for beancount","fork":true,"url":"https://api.github.com/repos/kljohann/vim-beancount","forks_url":"https://api.github.com/repos/kljohann/vim-beancount/forks","keys_url":"https://api.github.com/repos/kljohann/vim-beancount/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kljohann/vim-beancount/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kljohann/vim-beancount/teams","hooks_url":"https://api.github.com/repos/kljohann/vim-beancount/hooks","issue_events_url":"https://api.github.com/repos/kljohann/vim-beancount/issues/events{/number}","events_url":"https://api.github.com/repos/kljohann/vim-beancount/events","assignees_url":"https://api.github.com/repos/kljohann/vim-beancount/assignees{/user}","branches_url":"https://api.github.com/repos/kljohann/vim-beancount/branches{/branch}","tags_url":"https://api.github.com/repos/kljohann/vim-beancount/tags","blobs_url":"https://api.github.com/repos/kljohann/vim-beancount/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kljohann/vim-beancount/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kljohann/vim-beancount/git/refs{/sha}","trees_url":"https://api.github.com/repos/kljohann/vim-beancount/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kljohann/vim-beancount/statuses/{sha}","languages_url":"https://api.github.com/repos/kljohann/vim-beancount/languages","stargazers_url":"https://api.github.com/repos/kljohann/vim-beancount/stargazers","contributors_url":"https://api.github.com/repos/kljohann/vim-beancount/contributors","subscribers_url":"https://api.github.com/repos/kljohann/vim-beancount/subscribers","subscription_url":"https://api.github.com/repos/kljohann/vim-beancount/subscription","commits_url":"https://api.github.com/repos/kljohann/vim-beancount/commits{/sha}","git_commits_url":"https://api.github.com/repos/kljohann/vim-beancount/git/commits{/sha}","comments_url":"https://api.github.com/repos/kljohann/vim-beancount/comments{/number}","issue_comment_url":"https://api.github.com/repos/kljohann/vim-beancount/issues/comments{/number}","contents_url":"https://api.github.com/repos/kljohann/vim-beancount/contents/{+path}","compare_url":"https://api.github.com/repos/kljohann/vim-beancount/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kljohann/vim-beancount/merges","archive_url":"https://api.github.com/repos/kljohann/vim-beancount/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kljohann/vim-beancount/downloads","issues_url":"https://api.github.com/repos/kljohann/vim-beancount/issues{/number}","pulls_url":"https://api.github.com/repos/kljohann/vim-beancount/pulls{/number}","milestones_url":"https://api.github.com/repos/kljohann/vim-beancount/milestones{/number}","notifications_url":"https://api.github.com/repos/kljohann/vim-beancount/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kljohann/vim-beancount/labels{/name}","releases_url":"https://api.github.com/repos/kljohann/vim-beancount/releases{/id}","created_at":"2015-01-07T16:34:27Z","updated_at":"2015-01-07T16:34:27Z","pushed_at":"2015-05-21T10:39:10Z","git_url":"git://github.com/kljohann/vim-beancount.git","ssh_url":"git@github.com:kljohann/vim-beancount.git","clone_url":"https://github.com/kljohann/vim-beancount.git","svn_url":"https://github.com/kljohann/vim-beancount","homepage":null,"size":99,"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":"nathangrigg:master","ref":"master","sha":"c3ed247909501c093a1c9ccb7f47e1b4a960c06f","user":{"login":"nathangrigg","id":896960,"avatar_url":"https://avatars.githubusercontent.com/u/896960?v=3","gravatar_id":"","url":"https://api.github.com/users/nathangrigg","html_url":"https://github.com/nathangrigg","followers_url":"https://api.github.com/users/nathangrigg/followers","following_url":"https://api.github.com/users/nathangrigg/following{/other_user}","gists_url":"https://api.github.com/users/nathangrigg/gists{/gist_id}","starred_url":"https://api.github.com/users/nathangrigg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathangrigg/subscriptions","organizations_url":"https://api.github.com/users/nathangrigg/orgs","repos_url":"https://api.github.com/users/nathangrigg/repos","events_url":"https://api.github.com/users/nathangrigg/events{/privacy}","received_events_url":"https://api.github.com/users/nathangrigg/received_events","type":"User","site_admin":false},"repo":{"id":24867673,"name":"vim-beancount","full_name":"nathangrigg/vim-beancount","owner":{"login":"nathangrigg","id":896960,"avatar_url":"https://avatars.githubusercontent.com/u/896960?v=3","gravatar_id":"","url":"https://api.github.com/users/nathangrigg","html_url":"https://github.com/nathangrigg","followers_url":"https://api.github.com/users/nathangrigg/followers","following_url":"https://api.github.com/users/nathangrigg/following{/other_user}","gists_url":"https://api.github.com/users/nathangrigg/gists{/gist_id}","starred_url":"https://api.github.com/users/nathangrigg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathangrigg/subscriptions","organizations_url":"https://api.github.com/users/nathangrigg/orgs","repos_url":"https://api.github.com/users/nathangrigg/repos","events_url":"https://api.github.com/users/nathangrigg/events{/privacy}","received_events_url":"https://api.github.com/users/nathangrigg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nathangrigg/vim-beancount","description":"Vim ftplugin for beancount","fork":false,"url":"https://api.github.com/repos/nathangrigg/vim-beancount","forks_url":"https://api.github.com/repos/nathangrigg/vim-beancount/forks","keys_url":"https://api.github.com/repos/nathangrigg/vim-beancount/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nathangrigg/vim-beancount/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nathangrigg/vim-beancount/teams","hooks_url":"https://api.github.com/repos/nathangrigg/vim-beancount/hooks","issue_events_url":"https://api.github.com/repos/nathangrigg/vim-beancount/issues/events{/number}","events_url":"https://api.github.com/repos/nathangrigg/vim-beancount/events","assignees_url":"https://api.github.com/repos/nathangrigg/vim-beancount/assignees{/user}","branches_url":"https://api.github.com/repos/nathangrigg/vim-beancount/branches{/branch}","tags_url":"https://api.github.com/repos/nathangrigg/vim-beancount/tags","blobs_url":"https://api.github.com/repos/nathangrigg/vim-beancount/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nathangrigg/vim-beancount/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nathangrigg/vim-beancount/git/refs{/sha}","trees_url":"https://api.github.com/repos/nathangrigg/vim-beancount/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nathangrigg/vim-beancount/statuses/{sha}","languages_url":"https://api.github.com/repos/nathangrigg/vim-beancount/languages","stargazers_url":"https://api.github.com/repos/nathangrigg/vim-beancount/stargazers","contributors_url":"https://api.github.com/repos/nathangrigg/vim-beancount/contributors","subscribers_url":"https://api.github.com/repos/nathangrigg/vim-beancount/subscribers","subscription_url":"https://api.github.com/repos/nathangrigg/vim-beancount/subscription","commits_url":"https://api.github.com/repos/nathangrigg/vim-beancount/commits{/sha}","git_commits_url":"https://api.github.com/repos/nathangrigg/vim-beancount/git/commits{/sha}","comments_url":"https://api.github.com/repos/nathangrigg/vim-beancount/comments{/number}","issue_comment_url":"https://api.github.com/repos/nathangrigg/vim-beancount/issues/comments{/number}","contents_url":"https://api.github.com/repos/nathangrigg/vim-beancount/contents/{+path}","compare_url":"https://api.github.com/repos/nathangrigg/vim-beancount/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nathangrigg/vim-beancount/merges","archive_url":"https://api.github.com/repos/nathangrigg/vim-beancount/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nathangrigg/vim-beancount/downloads","issues_url":"https://api.github.com/repos/nathangrigg/vim-beancount/issues{/number}","pulls_url":"https://api.github.com/repos/nathangrigg/vim-beancount/pulls{/number}","milestones_url":"https://api.github.com/repos/nathangrigg/vim-beancount/milestones{/number}","notifications_url":"https://api.github.com/repos/nathangrigg/vim-beancount/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nathangrigg/vim-beancount/labels{/name}","releases_url":"https://api.github.com/repos/nathangrigg/vim-beancount/releases{/id}","created_at":"2014-10-06T22:36:13Z","updated_at":"2015-04-15T23:17:00Z","pushed_at":"2015-05-21T10:42:07Z","git_url":"git://github.com/nathangrigg/vim-beancount.git","ssh_url":"git@github.com:nathangrigg/vim-beancount.git","clone_url":"https://github.com/nathangrigg/vim-beancount.git","svn_url":"https://github.com/nathangrigg/vim-beancount","homepage":null,"size":445,"stargazers_count":1,"watchers_count":1,"language":"VimL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nathangrigg/vim-beancount/pulls/7"},"html":{"href":"https://github.com/nathangrigg/vim-beancount/pull/7"},"issue":{"href":"https://api.github.com/repos/nathangrigg/vim-beancount/issues/7"},"comments":{"href":"https://api.github.com/repos/nathangrigg/vim-beancount/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/nathangrigg/vim-beancount/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/nathangrigg/vim-beancount/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nathangrigg/vim-beancount/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/nathangrigg/vim-beancount/statuses/8fbe86e0f0bf9948ef8d626b147c22a3b88f335b"}}}}