Completation incomplete on accented words
Hi, first of all, thanks by the plugin! Is awesome. Now, the issue:
Problem summary
When a word has any special character the plugin truncate the word in the popup dialog. The problem sounds similar to the described here.
Expected
Show the entire word.
Environment Information
- OS: Linux (Archlinux)
- Vim version: GVim 7.4.373-1
- Relate .vimrc configuration lines:
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#sources#syntax#min_keyword_length = 3
let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
let g:neocomplete#sources#dictionary#dictionaries = {
\ 'default' : '',
\ 'vimshell' : $HOME.'/.vimshell_hist',
\ 'scheme' : $HOME.'/.gosh_completions'
\ }
if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns['default'] = '\h\w*'
Reproducible ways from Vim starting
- Write some words with accents AFTER of minimum numbers of letters to complete
- Try to use complete function with these words
Screenshot:

It is feature.
You can change g:neocomplete#keyword_pattterns value.
https://github.com/Shougo/neocomplcache.vim/issues/223
Oohhhh I'm sorry, I misunderstood that issue. Now I'm doing the correct keyword_patterns definition.
But... I have a little problem. Can you help me? My objective is complete every word in portuguese. It has words with regular 26 characters plus "á", "â", "ü", etc. I did this definition:
let g:neocomplete#keyword_patterns['markdown'] = '\h\w*[À-ú]*\w*'
It works fine for any word that has only one group of accents characters (for example canção). But words like bênção that has two: "ê" and "çã" doesn't work. I tried
let g:neocomplete#keyword_patterns['markdown'] = '\h\w*[À-ú\w*]*'
and
let g:neocomplete#keyword_patterns['markdown'] = '\h\w*[[À-ú]*\w*]*\w*'
but both didn't work. I don't know if it's my poor regular expressions skills or something else.
Thanks!
let g:neocomplete#keyword_patterns['markdown'] = '[À-ú[:alpha:]_][À-ú[:alnum:]_]*'
is better solution.
It worked great! Thanks a lot :)
@Shougo I want to add support for the following accents: áéíóúÁÉÍÓÚ. In order to do so, is it correct to replace let g:neocomplete#keyword_patterns._ = '\h\w* with
let g:neocomplete#keyword_patterns._ = '[A-Za-zá-úÁ-Ú_][0-9A-Za-zá-úÁ-Ú_]*'
?
Is that regex correct?
If I also want to add the letters Ñ and ñ then what's the correct regex? Should I add them like this:
let g:neocomplete#keyword_patterns._ = '[A-Za-zá-úÁ-ÚñÑ_][0-9A-Za-zá-úÁ-ÚñÑ_]*'
?
Thanks for the help.
Unfortunatelly, I don't use accented words. I don't know your regex is correct. You should test the regex.
@Shougo Thanks anyway!!