{"action":"created","comment":{"url":"https://api.github.com/repos/ajh17/VimCompletesMe/pulls/comments/53544653","id":53544653,"diff_hunk":"@@ -23,64 +23,57 @@ if !exists('g:vcm_default_maps')\n endif\n \n if !exists('g:vcm_omni_pattern')\n-  let g:vcm_omni_pattern = '\\v(\\.\\|->\\|::)'\n+  let g:vcm_omni_pattern = '\\v\\k+(\\.|->|::)\\k*$'\n+endif\n+\n+if !exists('g:vcm_tab_complete')\n+  let g:vcm_tab_complete = ''\n endif\n \n \" Functions: {{{1\n function! s:vim_completes_me(shift_tab)\n-  let dirs = [\"\\<c-p>\", \"\\<c-n>\"]\n-  let dir = g:vcm_direction =~? '[nf]'\n-  let map = exists('b:vcm_tab_complete') ? b:vcm_tab_complete : ''\n+  let Ctrl_PN = (g:vcm_direction ==# 'n') && !a:shift_tab ? \"\\<c-p>\" : \"\\<c-n>\"\n \n   if pumvisible()\n-    if a:shift_tab\n-      return dirs[!dir]\n-    else\n-      return dirs[dir]\n-    endif\n+      return Ctrl_PN\n   endif\n \n-  \" Figure out whether we should indent.\n+  \" Cursor after whitespace => indent\n   let pos = getpos('.')\n   let substr = matchstr(strpart(getline(pos[1]), 0, pos[2]-1), \"[^ \\t]*$\")\n-  if strlen(substr) == 0\n+  if empty(substr)\n     return (a:shift_tab && !g:vcm_s_tab_behavior) ? \"\\<C-d>\" : \"\\<Tab>\"\n   endif\n \n-  \" Figure out if user has started typing a path or a period or an arrow\n-  \" operator\n-  let omni_pattern = match(substr, get(b:, 'vcm_omni_pattern')) != -1\n-  let file_path = (has('win32') || has('win64')) ? '\\\\' : '\\/'\n-  let file_pattern = match(substr, file_path) != -1\n-\n-  if file_pattern\n-    return \"\\<C-x>\\<C-f>\"\n-  elseif omni_pattern && (&omnifunc != '')\n-    if get(b:, 'tab_complete_pos', []) == pos\n-      let exp = \"\\<C-x>\" . dirs[!dir]\n-    else\n-      let exp = \"\\<C-x>\\<C-o>\"\n-    endif\n-    let b:tab_complete_pos = pos\n-    return exp\n-  endif\n-\n-  \" First fallback to keyword completion if special completion was already tried.\n-  if exists('b:completion_tried') && b:completion_tried\n+  \" Completion failed => Vim's generic keyword completion\n+  if get(b:,'completion_tried') && (get(b:, 'tab_complete_pos', []) == pos)\n     let b:completion_tried = 0\n-    return \"\\<C-e>\" . dirs[!dir]\n+    return \"\\<C-e>\" . Ctrl_PN\n   endif\n \n-  \" Fallback\n+  \" Start completing => keep record for fallback\n+  let b:tab_complete_pos = pos\n   let b:completion_tried = 1\n-  if map ==? \"user\"\n-    return \"\\<C-x>\\<C-u>\"\n-  elseif map ==? \"omni\"\n+\n+  \" User is typing a path or omnicomplete or tabcomplete pattern?\n+  let omni_pattern = get(b:, 'vcm_omni_pattern', get(g:, 'vcm_omni_pattern'))\n+  let is_omni_pattern = (omni_pattern isnot 0) && (match(substr, omni_pattern) >= 0)","path":"plugin/VimCompletesMe.vim","position":74,"original_position":74,"commit_id":"cc0c355f9a9ab8b80e56874acab3078eda339dbf","original_commit_id":"cc0c355f9a9ab8b80e56874acab3078eda339dbf","user":{"login":"ajh17","id":1159146,"avatar_url":"https://avatars.githubusercontent.com/u/1159146?v=3","gravatar_id":"","url":"https://api.github.com/users/ajh17","html_url":"https://github.com/ajh17","followers_url":"https://api.github.com/users/ajh17/followers","following_url":"https://api.github.com/users/ajh17/following{/other_user}","gists_url":"https://api.github.com/users/ajh17/gists{/gist_id}","starred_url":"https://api.github.com/users/ajh17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajh17/subscriptions","organizations_url":"https://api.github.com/users/ajh17/orgs","repos_url":"https://api.github.com/users/ajh17/repos","events_url":"https://api.github.com/users/ajh17/events{/privacy}","received_events_url":"https://api.github.com/users/ajh17/received_events","type":"User","site_admin":false},"body":"Am I missing something? Why isnot used here instead of !=. Why are we comparing instance here?","created_at":"2016-02-20T04:59:17Z","updated_at":"2016-02-20T04:59:17Z","html_url":"https://github.com/ajh17/VimCompletesMe/pull/21#discussion_r53544653","pull_request_url":"https://api.github.com/repos/ajh17/VimCompletesMe/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/ajh17/VimCompletesMe/pulls/comments/53544653"},"html":{"href":"https://github.com/ajh17/VimCompletesMe/pull/21#discussion_r53544653"},"pull_request":{"href":"https://api.github.com/repos/ajh17/VimCompletesMe/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/ajh17/VimCompletesMe/pulls/21","id":59621539,"html_url":"https://github.com/ajh17/VimCompletesMe/pull/21","diff_url":"https://github.com/ajh17/VimCompletesMe/pull/21.diff","patch_url":"https://github.com/ajh17/VimCompletesMe/pull/21.patch","issue_url":"https://api.github.com/repos/ajh17/VimCompletesMe/issues/21","number":21,"state":"open","locked":false,"title":"A cleaner implementation of the tab complete option","user":{"login":"Konfekt","id":7195553,"avatar_url":"https://avatars.githubusercontent.com/u/7195553?v=3","gravatar_id":"","url":"https://api.github.com/users/Konfekt","html_url":"https://github.com/Konfekt","followers_url":"https://api.github.com/users/Konfekt/followers","following_url":"https://api.github.com/users/Konfekt/following{/other_user}","gists_url":"https://api.github.com/users/Konfekt/gists{/gist_id}","starred_url":"https://api.github.com/users/Konfekt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Konfekt/subscriptions","organizations_url":"https://api.github.com/users/Konfekt/orgs","repos_url":"https://api.github.com/users/Konfekt/repos","events_url":"https://api.github.com/users/Konfekt/events{/privacy}","received_events_url":"https://api.github.com/users/Konfekt/received_events","type":"User","site_admin":false},"body":"At same point, replace `inoremap <tab> ...` by `imap <tab> ..` to allow for say `z` used by https://github.com/chrisbra/unicode.vim\r\n","created_at":"2016-02-17T10:11:30Z","updated_at":"2016-02-20T04:59:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"febecf72b9bf7192afc8083d2d172d084a0e139d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ajh17/VimCompletesMe/pulls/21/commits","review_comments_url":"https://api.github.com/repos/ajh17/VimCompletesMe/pulls/21/comments","review_comment_url":"https://api.github.com/repos/ajh17/VimCompletesMe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ajh17/VimCompletesMe/issues/21/comments","statuses_url":"https://api.github.com/repos/ajh17/VimCompletesMe/statuses/cc0c355f9a9ab8b80e56874acab3078eda339dbf","head":{"label":"Konfekt:tabcomplete","ref":"tabcomplete","sha":"cc0c355f9a9ab8b80e56874acab3078eda339dbf","user":{"login":"Konfekt","id":7195553,"avatar_url":"https://avatars.githubusercontent.com/u/7195553?v=3","gravatar_id":"","url":"https://api.github.com/users/Konfekt","html_url":"https://github.com/Konfekt","followers_url":"https://api.github.com/users/Konfekt/followers","following_url":"https://api.github.com/users/Konfekt/following{/other_user}","gists_url":"https://api.github.com/users/Konfekt/gists{/gist_id}","starred_url":"https://api.github.com/users/Konfekt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Konfekt/subscriptions","organizations_url":"https://api.github.com/users/Konfekt/orgs","repos_url":"https://api.github.com/users/Konfekt/repos","events_url":"https://api.github.com/users/Konfekt/events{/privacy}","received_events_url":"https://api.github.com/users/Konfekt/received_events","type":"User","site_admin":false},"repo":null},"base":{"label":"ajh17:master","ref":"master","sha":"46a8025d4eaaf883daf03bdeb39bfbe646f47870","user":{"login":"ajh17","id":1159146,"avatar_url":"https://avatars.githubusercontent.com/u/1159146?v=3","gravatar_id":"","url":"https://api.github.com/users/ajh17","html_url":"https://github.com/ajh17","followers_url":"https://api.github.com/users/ajh17/followers","following_url":"https://api.github.com/users/ajh17/following{/other_user}","gists_url":"https://api.github.com/users/ajh17/gists{/gist_id}","starred_url":"https://api.github.com/users/ajh17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajh17/subscriptions","organizations_url":"https://api.github.com/users/ajh17/orgs","repos_url":"https://api.github.com/users/ajh17/repos","events_url":"https://api.github.com/users/ajh17/events{/privacy}","received_events_url":"https://api.github.com/users/ajh17/received_events","type":"User","site_admin":false},"repo":{"id":17973873,"name":"VimCompletesMe","full_name":"ajh17/VimCompletesMe","owner":{"login":"ajh17","id":1159146,"avatar_url":"https://avatars.githubusercontent.com/u/1159146?v=3","gravatar_id":"","url":"https://api.github.com/users/ajh17","html_url":"https://github.com/ajh17","followers_url":"https://api.github.com/users/ajh17/followers","following_url":"https://api.github.com/users/ajh17/following{/other_user}","gists_url":"https://api.github.com/users/ajh17/gists{/gist_id}","starred_url":"https://api.github.com/users/ajh17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajh17/subscriptions","organizations_url":"https://api.github.com/users/ajh17/orgs","repos_url":"https://api.github.com/users/ajh17/repos","events_url":"https://api.github.com/users/ajh17/events{/privacy}","received_events_url":"https://api.github.com/users/ajh17/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ajh17/VimCompletesMe","description":"You don't Complete Me; Vim Completes Me! A super simple, super minimal, super light-weight tab completion plugin for Vim.","fork":false,"url":"https://api.github.com/repos/ajh17/VimCompletesMe","forks_url":"https://api.github.com/repos/ajh17/VimCompletesMe/forks","keys_url":"https://api.github.com/repos/ajh17/VimCompletesMe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ajh17/VimCompletesMe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ajh17/VimCompletesMe/teams","hooks_url":"https://api.github.com/repos/ajh17/VimCompletesMe/hooks","issue_events_url":"https://api.github.com/repos/ajh17/VimCompletesMe/issues/events{/number}","events_url":"https://api.github.com/repos/ajh17/VimCompletesMe/events","assignees_url":"https://api.github.com/repos/ajh17/VimCompletesMe/assignees{/user}","branches_url":"https://api.github.com/repos/ajh17/VimCompletesMe/branches{/branch}","tags_url":"https://api.github.com/repos/ajh17/VimCompletesMe/tags","blobs_url":"https://api.github.com/repos/ajh17/VimCompletesMe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ajh17/VimCompletesMe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ajh17/VimCompletesMe/git/refs{/sha}","trees_url":"https://api.github.com/repos/ajh17/VimCompletesMe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ajh17/VimCompletesMe/statuses/{sha}","languages_url":"https://api.github.com/repos/ajh17/VimCompletesMe/languages","stargazers_url":"https://api.github.com/repos/ajh17/VimCompletesMe/stargazers","contributors_url":"https://api.github.com/repos/ajh17/VimCompletesMe/contributors","subscribers_url":"https://api.github.com/repos/ajh17/VimCompletesMe/subscribers","subscription_url":"https://api.github.com/repos/ajh17/VimCompletesMe/subscription","commits_url":"https://api.github.com/repos/ajh17/VimCompletesMe/commits{/sha}","git_commits_url":"https://api.github.com/repos/ajh17/VimCompletesMe/git/commits{/sha}","comments_url":"https://api.github.com/repos/ajh17/VimCompletesMe/comments{/number}","issue_comment_url":"https://api.github.com/repos/ajh17/VimCompletesMe/issues/comments{/number}","contents_url":"https://api.github.com/repos/ajh17/VimCompletesMe/contents/{+path}","compare_url":"https://api.github.com/repos/ajh17/VimCompletesMe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ajh17/VimCompletesMe/merges","archive_url":"https://api.github.com/repos/ajh17/VimCompletesMe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ajh17/VimCompletesMe/downloads","issues_url":"https://api.github.com/repos/ajh17/VimCompletesMe/issues{/number}","pulls_url":"https://api.github.com/repos/ajh17/VimCompletesMe/pulls{/number}","milestones_url":"https://api.github.com/repos/ajh17/VimCompletesMe/milestones{/number}","notifications_url":"https://api.github.com/repos/ajh17/VimCompletesMe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ajh17/VimCompletesMe/labels{/name}","releases_url":"https://api.github.com/repos/ajh17/VimCompletesMe/releases{/id}","deployments_url":"https://api.github.com/repos/ajh17/VimCompletesMe/deployments","created_at":"2014-03-21T09:00:58Z","updated_at":"2016-02-19T14:38:02Z","pushed_at":"2016-02-20T04:52:19Z","git_url":"git://github.com/ajh17/VimCompletesMe.git","ssh_url":"git@github.com:ajh17/VimCompletesMe.git","clone_url":"https://github.com/ajh17/VimCompletesMe.git","svn_url":"https://github.com/ajh17/VimCompletesMe","homepage":"","size":62,"stargazers_count":139,"watchers_count":139,"language":"VimL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":3,"forks":13,"open_issues":3,"watchers":139,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ajh17/VimCompletesMe/pulls/21"},"html":{"href":"https://github.com/ajh17/VimCompletesMe/pull/21"},"issue":{"href":"https://api.github.com/repos/ajh17/VimCompletesMe/issues/21"},"comments":{"href":"https://api.github.com/repos/ajh17/VimCompletesMe/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/ajh17/VimCompletesMe/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/ajh17/VimCompletesMe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ajh17/VimCompletesMe/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/ajh17/VimCompletesMe/statuses/cc0c355f9a9ab8b80e56874acab3078eda339dbf"}}}}