|
123456789101112131415161718192021222324252627282930313233 |
- if get(s:, 'loaded', 0)
- finish
- endif
- let s:loaded = 1
-
- let g:ncm2_khard#proc = yarp#py3({
- \ 'module': 'ncm2_khard',
- \ 'on_load': { -> ncm2#set_ready(g:ncm2_khard#source)}
- \ })
-
- let g:ncm2_khard#source = extend(get(g:, 'ncm2_khard#source', {}), {
- \ 'name': 'khard',
- \ 'ready': 0,
- \ 'priority': 5,
- \ 'mark': 'b',
- \ 'scope': ['mail'],
- \ 'complete_pattern': ['^To: ', '^Cc: ', '^Bcc: '],
- \ 'on_complete': 'ncm2_khard#on_complete',
- \ 'on_warmup': 'ncm2_khard#on_warmup',
- \ }, 'keep')
-
- func! ncm2_khard#init()
- call ncm2#register_source(g:ncm2_khard#source)
- endfunc
-
- func! ncm2_khard#on_warmup(ctx)
- call g:ncm2_khard#proc.jobstart()
- endfunc
-
- func! ncm2_khard#on_complete(ctx)
- call g:ncm2_khard#proc.try_notify('on_complete', a:ctx)
- endfunc
-
|