Add "s" snippet option which, if set, will cause trailing whitespace to
be stripped from lines before jumping to the next tab stop.
When used with a snippet like the following this will allow the text
from the $1 tabstop to be removed and have the space in front of that
automatically deleted when the user jumps to $2. This will work even if
using the same key for snippet expansion and jumping to the next
tabstop, whereas if the space was manually removed the key would cause
the snippet to be expanded again.
snippet do "do block" s
do `!p snip.rv = "|" if t[1] else""`${1:args}`!p snip.rv = "|" if t[1] else""`
$2
end
$0
endsnippet
When a Snippet object creates a SnippetInstance it should pass itself as
an argument, so that the instance can later get additional information
about the snippet.
Encapsulate the fact that options are stored as the original string that
was pulled from the definition. This will simplify things if that ever
needs to be changed.
There's no need to use different code to create a SnippetInstance based
on whether or not there's a parent. The arguments passed either way are
the same.
Modify new_scratch_buffer method to leave the created buffer in command
rather than insert mode. Currently the only use of this method is for
showing stack traces for errors, when that happens it's much more likely
that the user will want to use command mode to move around than to use
insert mode to add text to the beginning of the buffer.
Don't warn about missing python support if the UltiSnipsNoPythonWarning
variable is defined. This allows users to use a common set of vim
configuration files across a range of systems, even if some of them do
not have python support compiled into vim.
Define a dummy version of the UltiSnips_FileTypeChanged function before
checking for python support. If that function isn't defined, the
autocommand defined in ftdetect/UltiSnips.vim will cause an error any
time a new file is opened. That autocommand is setup before the
function is defined, so we can't setup the autocommand only when the
function exists.
Commit 13331a8 added code to show the current line after insertions, but
later changes caused that to be called too soon. This left folds
created by a snippet closed, and the cursor at the end of the insertion.