Merge pull request #1270 from ZyX-I/fix-1268

Make sure python_to_vim function is able to format lists
This commit is contained in:
Nikolai Aleksandrovich Pavlov 2015-01-12 07:54:04 +03:00
commit 761a035765

View File

@ -50,6 +50,11 @@ python_to_vim_types = {
ord('\''): '\'\'', ord('\''): '\'\'',
}).encode(vim_encoding)) + b'\'' }).encode(vim_encoding)) + b'\''
), ),
list: (
lambda o: b'[' + (
b','.join((python_to_vim(i) for i in o))
) + b']'
),
bytes: (lambda o: b'\'' + o.replace(b'\'', b'\'\'') + b'\''), bytes: (lambda o: b'\'' + o.replace(b'\'', b'\'\'') + b'\''),
int: (str if str is bytes else (lambda o: unicode(o).encode('ascii'))), int: (str if str is bytes else (lambda o: unicode(o).encode('ascii'))),
} }