aboutsummaryrefslogtreecommitdiffstats
path: root/ftplugin/gitcommit.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ftplugin/gitcommit.vim')
-rw-r--r--ftplugin/gitcommit.vim9
1 files changed, 5 insertions, 4 deletions
diff --git a/ftplugin/gitcommit.vim b/ftplugin/gitcommit.vim
index 485a7c1..e08f2e0 100644
--- a/ftplugin/gitcommit.vim
+++ b/ftplugin/gitcommit.vim
@@ -1,3 +1,5 @@
+let s:old_completefunc = &completefunc
+
function! GitSHAComplete(findstart, base)
if a:findstart
" locate the start of the word
@@ -9,6 +11,9 @@ function! GitSHAComplete(findstart, base)
return start
endif
+ " Restore user completion function
+ let &completefunc = s:old_completefunc
+
" Match Git SHAs in the current repository
let matches = []
let revs = system('git rev-list --all')
@@ -22,12 +27,8 @@ function! GitSHAComplete(findstart, base)
endfunction
function! StartGitSHACompletion()
- let old_completefunc = &completefunc
-
set completefunc=GitSHAComplete
return "\<C-x>\<C-u>"
-
- let &completefunc = old_completefunc
endfunction
inoremap <expr> <C-x><C-s> StartGitSHACompletion()