diff --git a/autoload/asyncomplete/sources/gitcommit.vim b/autoload/asyncomplete/sources/gitcommit.vim new file mode 100644 index 0000000..f1656a8 --- /dev/null +++ b/autoload/asyncomplete/sources/gitcommit.vim @@ -0,0 +1,19 @@ +function! asyncomplete#sources#gitcommit#completor(opt, ctx) abort + let l:col = a:ctx['col'] + let l:typed = a:ctx['typed'] + + let l:kw = matchstr(l:typed, '\v\S+$') + let l:kwlen = len(l:kw) + + let l:startcol = l:col - l:kwlen + + let l:matches = [ + \ "do", "if", "in", "for", "let", "new", "try", "var", "case", "else", "enum", "eval", "null", "this", "true", + \ "void", "with", "await", "break", "catch", "class", "const", "false", "super", "throw", "while", "yield", + \ "delete", "export", "import", "public", "return", "static", "switch", "typeof", "default", "extends", + \ "finally", "package", "private", "continue", "debugger", "function", "arguments", "interface", "protected", + \ "implements", "instanceof" + \ ] + + call asyncomplete#complete(a:opt['name'], a:ctx, l:startcol, l:matches) +endfunction