aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-04-29 04:56:56 +0200
committerTeddy Wing2017-04-29 04:56:56 +0200
commit0a271656ab963c30bfb82dca7f2cbd5d0fbb7ffb (patch)
tree89f708b7d6ddcd6df13052fb79eedec330b4563c
parentee60b16343ff5e98dc4279bb976586001a002bfe (diff)
downloadvim-gitcha-0a271656ab963c30bfb82dca7f2cbd5d0fbb7ffb.tar.bz2
autoload/gitcha.vim: Describe the code with comments
-rw-r--r--autoload/gitcha.vim4
1 files changed, 4 insertions, 0 deletions
diff --git a/autoload/gitcha.vim b/autoload/gitcha.vim
index 6defd61..bde75a2 100644
--- a/autoload/gitcha.vim
+++ b/autoload/gitcha.vim
@@ -1,5 +1,8 @@
+" Save user-defined completefunc so it can be restored after running this
+" custom completion function
let s:old_completefunc = &completefunc
+" Completion for Git SHAs in the current repository
function! gitcha#GitSHAComplete(findstart, base)
if a:findstart
" locate the start of the word
@@ -26,6 +29,7 @@ function! gitcha#GitSHAComplete(findstart, base)
return matches
endfunction
+" Allow mappings to initiate completion
function! gitcha#StartGitSHACompletion()
set completefunc=gitcha#GitSHAComplete
return "\<C-x>\<C-u>"