Shougo / neocomplcache.vim

Ultimate auto-completion system for Vim.
http://www.vim.org/scripts/script.php?script_id=2620
1.72k stars 135 forks source link

"key not present in dictionary" errors when i use brew install macvim, version is Vim 9.0.1276 (MacVim r176) #511

Closed owner888 closed 1 year ago

owner888 commented 1 year ago

but i searched v:version, only this line, but my old version is Custom Version 8.2.3455 (172), no this problem,

return has('lua') && (v:version > 703 || v:version == 703 && has('patch885'))

Error Info:

Error detected while processing CursorHold Autocommands for "*"..function neocomplcache#init#lazy[6]..neocomplcache#init#_others[1]..neocomplcache#init#_variables[347]..neocomplcache#util#set_default_dictionary[9]..neocomplcache#util#set_dictionary_helper:
line    1:
E116: Invalid arguments for function call(s:V.set_dictionary_helper, a:000)
Error detected while processing CursorHold Autocommands for "*"..function neocomplcache#init#lazy[6]..neocomplcache#init#_others[1]..neocomplcache#init#_variables[350]..neocomplcache#util#set_default_dictionary[9]..neocomplcache#util#set_dictionary_helper:
line    1:
E716: Key not present in Dictionary: "set_dictionary_helper"
Error detected while processing CursorHold Autocommands for "*"..function neocomplcache#init#lazy[6]..neocomplcache#init#_others[1]..neocomplcache#init#_variables[350]..neocomplcache#util#set_default_dictionary[9]..neocomplcache#util#set_dictionary_helper:
Shougo commented 1 year ago

Please upload the minimal vimrc. I will test it.

Shougo commented 1 year ago

I have tested the following vimrc with Vim 9.0.1561 and it works.

set rtp+=~/src/neocomplcache.vim

"Note: This option must set it in .vimrc(_vimrc).  NOT IN .gvimrc(_gvimrc)!
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplcache.
let g:neocomplcache_enable_at_startup = 1
" Use smartcase.
let g:neocomplcache_enable_smart_case = 1
" Set minimum syntax keyword length.
let g:neocomplcache_min_syntax_length = 3
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'

" Define keyword.
if !exists('g:neocomplcache_keyword_patterns')
    let g:neocomplcache_keyword_patterns = {}
endif
let g:neocomplcache_keyword_patterns['default'] = '\h\w*'

" Plugin key-mappings.
inoremap <expr><C-g>     neocomplcache#undo_completion()
inoremap <expr><C-l>     neocomplcache#complete_common_string()

" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
  return neocomplcache#smart_close_popup() . "\<CR>"
  " For no inserting <CR> key.
  "return pumvisible() ? neocomplcache#close_popup() : "\<CR>"
endfunction
" <TAB>: completion.
inoremap <expr><TAB>  pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><C-y>  neocomplcache#close_popup()
inoremap <expr><C-e>  neocomplcache#cancel_popup()
Shougo commented 1 year ago

And more newer version of macVim is released.

Please test it.

https://github.com/macvim-dev/macvim/releases/tag/prerelease-176.1

It is not plugin's problem and neocomplcahe's development is already over.

closing.

owner888 commented 1 year ago

thanks very much bro, yes it is closed, but I have too many machines, so I am still using this old version. If it is a simple problem, I can fix it and submit a patch to you, thanks bro

Shougo commented 1 year ago

I don't think it is simple problem. It seems Vim's bug. But I think it is fixed.

owner888 commented 1 year ago

I don't think it is simple problem. It seems Vim's bug. But I think it is fixed.

yes, i think so