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

Non-english completions #493

Closed naquad closed 9 years ago

naquad commented 9 years ago

Completion works fine with English characters, but it doesn't trigger with Russian while manual invocation of completion (<c-x><c-n>) works fine.

Shougo commented 9 years ago

It is feature. You want to complete non English characters, you must change g:neocomplcache#keyword_patterns variable.

https://github.com/Shougo/neocomplete.vim/issues/316

naquad commented 9 years ago

As I understand variable is g:neocomplcache_keyword_patterns['_']. I've set it to [\kА-Яа-я]\+ (which works: :echo match('тест', '[\kА-Яа-я]\+')) that didn't help :( Any clues?

UPD: file was text (test.txt)

Shougo commented 9 years ago

If you want to edit text filetype, you must change g:neocomplcache_keyword_patterns['text'].

naquad commented 9 years ago

that didn't help either :(

naquad commented 9 years ago

let g:neocomplcache_keyword_patterns['text']= '[\kа-яА-Я]\+' - not working

Shougo commented 9 years ago

I think you must regenerate cache by :NeoComplCacheClean.

naquad commented 9 years ago

Didn't help.

Shougo commented 9 years ago

It is same behavior on neocomplete? I don't want to change neocomplcache. But if neocomplete, I will check it.

naquad commented 9 years ago

I don't have neocomplete and can't check it.

Shougo commented 9 years ago

Oh, I get it. I think it is feature. Because, neocomplete or neocomplcache ignore multibyte input.

Shougo commented 9 years ago

It is neocomplete function. But neocomplcache is same.

function! neocomplete#is_multibyte_input(cur_text) "{{{
  return (exists('b:skk_on') && b:skk_on)
        \     || char2nr(split(a:cur_text, '\zs')[-1]) > 0x80
endfunction"}}}
Shougo commented 9 years ago

You cannot complete full multibyte input candidates like тест.

naquad commented 9 years ago

Erm so basically it can't be fixed because you call that bug a feature? 0o

Shougo commented 9 years ago

It is not bug. It is intended feature. Because, current GVim IM integration is buggy. Auto completion should not work on IM input. So, neocomplete/neocomplcache ignores multibyte input.

naquad commented 9 years ago

Could you please add some option to turn this off? like g:neocomplcache_force_multibite or something

Shougo commented 9 years ago

I don't want to change neocomplcache code. Pull request is wellcome.

Shougo commented 9 years ago

I think the name should beg:neocomplcache_enable_multibyte_completion.

naquad commented 9 years ago

https://github.com/naquad/neocomplcache.vim/commit/77d518050489e04a4197faf75f74405b8123b200

I've called it g:neocomplcache_allow_multibyte, but that can be changed. In any case that causes some unclear issue I can't figure out: completion looses last byte, i.e. was тест and suggestion is тес. Trying to figure it out.

Shougo commented 9 years ago

Well, neocomplcache has multibyte input bugs. Can you check it?