diff options
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/deoplete/handler.vim | 16 | ||||
-rw-r--r-- | autoload/deoplete/init.vim | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/autoload/deoplete/handler.vim b/autoload/deoplete/handler.vim index b1895f1..e355063 100644 --- a/autoload/deoplete/handler.vim +++ b/autoload/deoplete/handler.vim @@ -363,11 +363,27 @@ endfunction function! s:on_complete_done() abort if get(v:completed_item, 'word', '') ==# '' + \ || !has_key(g:deoplete#_context, 'complete_str') return endif call deoplete#handler#_skip_next_completion() + let max_used = 100 + let g:deoplete#_recently_used = insert( + \ g:deoplete#_recently_used, + \ tolower(v:completed_item.word), + \ ) + let min_pattern_length = deoplete#custom#_get_option('min_pattern_length') + if len(g:deoplete#_context['complete_str']) > min_pattern_length + let g:deoplete#_recently_used = insert( + \ g:deoplete#_recently_used, + \ tolower(g:deoplete#_context['complete_str']), + \ ) + endif + let g:deoplete#_recently_used = deoplete#util#uniq( + \ g:deoplete#_recently_used)[: max_used] + let user_data = get(v:completed_item, 'user_data', '') if type(user_data) !=# v:t_string || user_data ==# '' return diff --git a/autoload/deoplete/init.vim b/autoload/deoplete/init.vim index d2380e7..cd9ccfa 100644 --- a/autoload/deoplete/init.vim +++ b/autoload/deoplete/init.vim @@ -112,6 +112,7 @@ function! s:init_internal_variables() abort call deoplete#init#_prev_completion() let g:deoplete#_context = {} + let g:deoplete#_recently_used = [] if !exists('g:deoplete#_logging') let g:deoplete#_logging = {} |