1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- let s:cpo_save=&cpo
- set cpo&vim
-
-
-
- let s:k_version = 300
- function! lh#icomplete#version()
- return s:k_version
- endfunction
-
-
- let s:verbose = 0
- function! lh#icomplete#verbose(...)
- if a:0 > 0 | let s:verbose = a:1 | endif
- return s:verbose
- endfunction
-
- function! s:Verbose(expr)
- if s:verbose
- echomsg a:expr
- endif
- endfunction
-
- function! lh#icomplete#debug(expr)
- return eval(a:expr)
- endfunction
-
-
-
-
-
- function! lh#icomplete#run(startcol, matches, Hook)
- call lh#icomplete#_register_hook(a:Hook)
- call complete(a:startcol, a:matches)
- return ''
- endfunction
-
-
-
-
- function! lh#icomplete#_clear_key_bindings()
- iunmap <cr>
- iunmap <c-y>
- iunmap <esc>
-
-
- endfunction
-
-
- function! lh#icomplete#_register_hook(Hook)
- exe 'inoremap <silent> <cr> <cr><c-\><c-n>:call' .a:Hook . '()<cr>'
- exe 'inoremap <silent> <c-y> <c-y><c-\><c-n>:call' .a:Hook . '()<cr>'
-
-
-
-
- inoremap <silent> <esc> <c-e><esc>
-
- call lh#event#register_for_one_execution_at('InsertLeave',
- \ ':call lh#icomplete#_clear_key_bindings()', 'CompleteGroup')
- endfunction
-
-
- let &cpo=s:cpo_save
-
|