summaryrefslogtreecommitdiff
path: root/autoload/deoplete.vim
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2017-01-08 20:23:23 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2017-01-08 20:23:23 +0900
commitabf45344f484a58eec6aa8c17ff81f00f77b4d43 (patch)
tree265f0e30a1f122a00a2d0168919371d20c6ed7f4 /autoload/deoplete.vim
parent91e26004b8f33c8ffa726708ad46ab7a0a2ad6a7 (diff)
downloaddeoplete.nvim-abf45344f484a58eec6aa8c17ff81f00f77b4d43.zip
Fix mappings errors
Diffstat (limited to 'autoload/deoplete.vim')
-rw-r--r--autoload/deoplete.vim20
1 files changed, 14 insertions, 6 deletions
diff --git a/autoload/deoplete.vim b/autoload/deoplete.vim
index 87b5aaa..5772feb 100644
--- a/autoload/deoplete.vim
+++ b/autoload/deoplete.vim
@@ -44,21 +44,29 @@ function! deoplete#manual_complete(...) abort
\ . string(get(a:000, 0, [])) . ")\<CR>"
endfunction
function! deoplete#close_popup() abort
- let g:deoplete#_context.position = getpos('.')
+ if exists('g:deoplete#_context')
+ let g:deoplete#_context.position = getpos('.')
+ endif
return pumvisible() ? "\<C-y>" : ''
endfunction
function! deoplete#smart_close_popup() abort
- let g:deoplete#_context.position = getpos('.')
+ if exists('g:deoplete#_context')
+ let g:deoplete#_context.position = getpos('.')
+ endif
return pumvisible() ? "\<C-e>" : ''
endfunction
function! deoplete#cancel_popup() abort
- let g:deoplete#_context.position = getpos('.')
+ if exists('g:deoplete#_context')
+ let g:deoplete#_context.position = getpos('.')
+ endif
return pumvisible() ? "\<C-e>" : ''
endfunction
function! deoplete#refresh() abort
- let g:deoplete#_context.refresh = 1
- if get(g:deoplete#_context, 'event', '') ==# 'Manual'
- let g:deoplete#_context.event = 'Refresh'
+ if exists('g:deoplete#_context')
+ let g:deoplete#_context.refresh = 1
+ if get(g:deoplete#_context, 'event', '') ==# 'Manual'
+ let g:deoplete#_context.event = 'Refresh'
+ endif
endif
return pumvisible() ? "\<C-e>" : ''
endfunction