The snippet/global regions were always ending correctly, but an unclosed
contained region could cause the wrong highlighting to apply to the
endsnippet/endglobal. Tweak the definitions such that the snippet/global
regions actually end at the start of the line and the footer occurs
outside the region.
Remove a few obsolete items.
Remove the snipTabsOnly item. A tab-only line is not necessarily an
error.
Color leading spaces with a red background, because the default Error
coloring doesn't affect the display of spaces.
The body of a global now only has Python syntax coloring if the trigger
is !p. This matches the actual behavior of UltiSnips. AFAIK right now
globals with other triggers are useless, but this opens the door to
proper syntax coloring for those if they ever gain a use.
Include the sh syntax for shell commands.
Make the matching on !v/!p work more accurately.
Highlight the !v/!p separately from the embedded Python/VimL.
AFAIK the only issue now is that "\`" escapes inside shell/VimL/Python
are not treated as bare "`" characters by the embedded syntax, but I
don't believe there's any way to fix that.
In py2 we could get by with attempting to encode/decode a string and if
it failed just ignore and return. Unfortunately on py3 a string decodes
to a bytearray and a bytearray encodes to a string. We can't simply
return the original object when we fail. We choose replace for handling
bytes we don't understand.
Test case (using python3 for UltiSnips):
open a new file
:set encoding=utf-8
qa<Backspace>q
"ap
Warning: this test case makes it very difficult to exit vim cleanly and
save files!
Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
When bootstrapping fails to setup `g:_uspy` (e.g. without Python),
the functions used in the autocommands are not being defined.
Since it makes no sense to have autocommands defined for UltiSnips in this
case, this patch deletes them (via a new augroup 'UltiSnips').
In windows when expanding snippets the names of the snippet files look weird because \ is not escaped properly.
Also I think there should be an option to show only part of the file name, say the path relative to ~/.vim, because this way most of the screen is taken with the paths of the file.
Going even further I think it would it look nicer if you had some kind of alignment for the string. Say "%2i: %-15s (%s)".
Of course this last suggestion might not be consensual, but maybe a option might be offered to the user.