diff options
author | Teddy Wing | 2017-05-10 05:10:41 +0200 |
---|---|---|
committer | Teddy Wing | 2017-05-10 05:53:57 +0200 |
commit | 60bc8ea8b3b7be511c4240ca1d7dc1cc1149b113 (patch) | |
tree | 2f118dac7c6085c63c95ffad4dec3d437d436dc8 /ftplugin/gitcommit/gitcha.vim | |
parent | e7fb8f326e7c3e184e305286199640fdaac35d5b (diff) | |
download | vim-gitcha-60bc8ea8b3b7be511c4240ca1d7dc1cc1149b113.tar.bz2 |
gitcha#GitSHAComplete(): Use `complete()` to open popup menu (WIP)
Work in progress
Rough code for a working implementation using `complete()` instead of
'completefunc'.
Rejigger `start` and make a new `base` variable since we can no longer
get it as an argument.
Correctly reset 'completeopt' to its original user value after opening
the popup menu.
Return an empty string from the function as recommended by
:h complete()
Diffstat (limited to 'ftplugin/gitcommit/gitcha.vim')
-rw-r--r-- | ftplugin/gitcommit/gitcha.vim | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ftplugin/gitcommit/gitcha.vim b/ftplugin/gitcommit/gitcha.vim index 19f4a0b..9be271d 100644 --- a/ftplugin/gitcommit/gitcha.vim +++ b/ftplugin/gitcommit/gitcha.vim @@ -8,10 +8,13 @@ if exists('g:no_plugin_maps') || exists('g:no_gitcha_maps') finish endif -if !hasmapto('<Plug>GitchaCompleteSHA') - imap <buffer> <C-x><C-s> <Plug>GitchaCompleteSHA -endif +" if !hasmapto('<Plug>GitchaCompleteSHA') +" imap <buffer> <C-x><C-s> <Plug>GitchaCompleteSHA +" endif -inoremap <buffer> <expr> <Plug>GitchaCompleteSHA gitcha#StartGitSHACompletion() +" inoremap <buffer> <Plug>GitchaCompleteSHA <C-r>=gitcha#StartGitSHACompletion()<CR> +" inoremap <buffer> <Plug>GitchaCompleteSHA <C-r>=gitcha#GitSHAComplete()<CR> +" inoremap <buffer> <C-x><C-s> <C-r>=gitcha#GitSHAComplete()<CR> +inoremap <C-x><C-s> <C-r>=gitcha#GitSHAComplete()<CR> let b:undo_ftplugin = 'iunmap <buffer> <C-x><C-s>' |