Commit Graph

6 Commits

Author SHA1 Message Date
Holger Rapp
becab789a8 Remove bootstrap.vim. Simplify startup.
The python module is now pulled in autoload/UltiSnips.vim. This means
that parsing of the .vimrc will only map the keys and set some options -
very cheap.

Unfortunately, the autocommands set up in plugin/UltiSnips.vim pulls in
the python code basically immediately still.
2015-07-11 16:17:50 +02:00
Holger Rapp
6a787cdc7b Applied pyformat on entire codebase. 2015-01-20 21:26:03 +01:00
John Szakmeister
8b2115ec26 Fix #171: UltiSnips crashes in new file with text containing 0x80 char
It turns out that vim.eval() will attempt to do Unicode conversion and
can fail when raw bytes are present in the unnamed register.  To avoid
this problem, let's not carry the value across the bridge, and instead
store the cached value in Vim directly.  This successfully sidesteps the
issue entirely, and provides the correct save and restore behavior.

This also adds a test case for the issue.  Since expansion can finish
(despite the errors), the test has to capture the error messages and
examine them for a failure.
2014-11-21 06:09:49 -05:00
John Szakmeister
f4df1bd9e8 Teach _vim_enc to handle UnicodeDecodeErrors.
It's possible that when using _vim_dec with Python 2 that we fail to
convert the string to Unicode and just return the raw string instead.
This could happen, for instance, when there was arbitrary data in the
unnamed register during the save/restore process.  During restoration,
we'd attempt to encode the string, but this may fail with a
UnicodeDecodeError as Python attempts to first convert to Unicode and
then to the requested encoding.

To fix this, let's also catch `UnicodeDecodeError` and return the raw
string if we fail to convert.
2014-11-21 06:09:18 -05:00
Glenn Griffin
e3abd6678f Added test case for shiftwidth=0 and added myself to contributors list. 2014-10-08 10:30:40 -07:00
cwahbong
1cf3b928fe Refactor: split test.py into several smaller files. 2014-07-23 17:22:11 +08:00