neocomplete.vim icon indicating copy to clipboard operation
neocomplete.vim copied to clipboard

Completation incomplete on accented words

Open vialrogo opened this issue 12 years ago • 7 comments

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

  1. Write some words with accents AFTER of minimum numbers of letters to complete
  2. Try to use complete function with these words

Screenshot:

screenshot

vialrogo avatar Jul 28 '14 21:07 vialrogo

It is feature. You can change g:neocomplete#keyword_pattterns value.

https://github.com/Shougo/neocomplcache.vim/issues/223

Shougo avatar Jul 28 '14 22:07 Shougo

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!

vialrogo avatar Jul 30 '14 01:07 vialrogo

let g:neocomplete#keyword_patterns['markdown'] = '[À-ú[:alpha:]_][À-ú[:alnum:]_]*'

is better solution.

Shougo avatar Jul 30 '14 11:07 Shougo

It worked great! Thanks a lot :)

vialrogo avatar Jul 30 '14 13:07 vialrogo

@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.

petobens avatar Aug 28 '14 03:08 petobens

Unfortunatelly, I don't use accented words. I don't know your regex is correct. You should test the regex.

Shougo avatar Aug 28 '14 13:08 Shougo

@Shougo Thanks anyway!!

petobens avatar Aug 28 '14 13:08 petobens