cohama / lexima.vim

Auto close parentheses and repeat by dot dot dot...
996 stars 46 forks source link

Don't expand if popup menu is available (on completion menu) on <CR> #49

Closed josueetcom closed 8 years ago

josueetcom commented 8 years ago

Hi! I'm really enjoying your plugin, but because I'm using the AutoComplPop plugin things were not working correctly when I pressed enter to select a completion from the pop up menu.

So, I had to change this one line in autoload/lexima/insmode.vim inside the function lexima#insmode#_expand(char) Line 93 from:

if !has_key(s:map_dict, char) || mode() !=# 'i'

to

if !has_key(s:map_dict, char) || mode() !=# 'i' || pumvisible() && a:char ==# ''

That way, if the pop up menu for completion is visible (AutoComplPop shows it while typing a letter/word) then the mapping for will return the default instead of going to a new line. After this change it all works fantastically!

cohama commented 8 years ago

Thanks for your idea. But your code breaks triggering abbreviation expansion.

I have fixed this problem by other way. Please try the latest version.

Please see #43 for details.