* Improve/simplify filetype handling for buffers
There is no need to have a FileType autocmd anymore, which for some odd
reason even had to be in "ftdetect"?!
Now it will just use the `&filetype` property from buffers, instead of
updating it on FileType events.
This allows for easier lazy-loading of UltiSnips; without this patch it
would not have updated the list of filetypes for the buffer after just
being triggered (e.g. through NeoBundle's lazy-loading).
I am using the following currently:
NeoBundleLazy 'SirVer/ultisnips', {
\ 'on_funcs': ['UltiSnips#ExpandSnippetOrJump']}
inoremap <silent> <c-j> <C-R>=UltiSnips#ExpandSnippetOrJump()<cr>
By manually defining the mapping for the trigger, I can invoke it and
NeoBundle will trigger the loading of the plugin.
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.
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').
Removed parsing responsibilities from SnippetManager and instead put
them into the new module providers. Renamed private methods on
SnippetManager that are not meant to be called by external libraries to
start with _. Refactored tests so that expected failures can be tested
and therefore removed the testing flag from SnippetManager.
If a python module tried to load UltiSnips without the autoload file
being run first, UltiSnips_Manager was not defined. This broke YCM and
maybe others too. This fixes
https://github.com/Valloric/YouCompleteMe/issues/820.