'Try to expand a snippet in the current place.'

def _try_expand(self, autotrigger_only=False):

    before = _vim.buf.line_till_cursor
    snippets = self._snips(before, False, autotrigger_only)
    if snippets:
        snippets_with_context = [s for s in snippets if s.context]
        if snippets_with_context:
            snippets = snippets_with_context
    if (not snippets):
        return False
    _vim.command('let    &undolevels    =    &undolevels')
    if (len(snippets) == 1):
        snippet = snippets[0]
    else:
        snippet = _ask_snippets(snippets)
        if (not snippet):
            return True
    self._do_snippet(snippet, before)
    _vim.command('let    &undolevels    =    &undolevels')
    return True
