lyokha / vim-xkbswitch

vim plugin for automatic keyboard layout switching in insert mode
MIT License
481 stars 23 forks source link

Error detected while processing function <SNR>180_tr_load: #23

Open coresh opened 9 years ago

coresh commented 9 years ago

vim running and :messages output :

vim-xkbswitch/plugin/xkbswitch.vim:126 Error detected while processing function 180_tr_load:
line 8: E684: list index out of range: 0 E15: Invalid expression: data[0] == '<' || data[0] == '>'

lyokha commented 9 years ago

What is content of your file pointed by :echo g:XkbSwitchIMappingsTrData?

coresh commented 9 years ago

/home/admin/.vim/xkbswitch/xkbswitch.tr

cat /home/admin/.vim/xkbswitch/xkbswitch.tr ru Russian winkeys layout < qwertyuiop[]asdfghjkl;'zxcvbnm,.`/QWERTYUIOP{}ASDFGHJKL:"ZXCVBNM<>?~@#$^&|

йцукенгшщзхъфывапролджэячсмитьбюё.ЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ,Ё"№;:?/

de < yz-[];'/YZ{}:"<>?~@#^&*(_\

zyßü+öä-ZYÜ*ÖÄ;:_°"§&/()?#

lyokha commented 9 years ago

By some reason the regexp check for empty lines in the plugin code

        if line =~ '\(^\s*#\|^\s*$\)'
            continue
        endif

is not working in your environment. I just checked it with latest vim on a Linux machine with different regexpengine set (1 and 2): all variants work. You can try to play with this value setting in your .vimrc

set regexpengine=1

(or 2), but this is global! Probably your libpcre is something strange (do you use Windows machine?).

The easiest way to fix this is just remove empty lines in your xkbswitch.tr. ))