diff --git a/doc/UltiSnips.txt b/doc/UltiSnips.txt index 92d6a31..66cff83 100644 --- a/doc/UltiSnips.txt +++ b/doc/UltiSnips.txt @@ -387,11 +387,10 @@ UltiSnips provides some functions for extending core functionality. 3.5.1 UltiSnips#AddSnippet *UltiSnips#AddSnippet* The first function is UltiSnips#AddSnippet(trigger, value, description, -options, ...). It adds a new snippet with the provided trigger, value, +options, filetyp="all"). It adds a new snippet with the provided trigger, value, description, and options to the current list of snippets. See |UltiSnips-syntax| for details on the meaning of the function arguments. All -arguments are strings. An optional fifth argument can be used to specify the -filetype for the new snippet. +arguments are strings. 3.5.2 UltiSnips#Anon *UltiSnips#Anon* diff --git a/pythonx/UltiSnips/providers/added_snippets_provider.py b/pythonx/UltiSnips/providers/added_snippets_provider.py index ad08eb3..d468e43 100755 --- a/pythonx/UltiSnips/providers/added_snippets_provider.py +++ b/pythonx/UltiSnips/providers/added_snippets_provider.py @@ -1,14 +1,14 @@ #!/usr/bin/env python # encoding: utf-8 -"""Handles manually added snippets (i.e. not in a file).""" +"""Handles manually added snippets through UltiSnips#AddSnippet or +UltiSnips_Manager.add_snippet().""" from UltiSnips.providers._base import SnippetProvider class AddedSnippetsProvider(SnippetProvider): """See module docstring.""" - # TODO(sirver): filename makes no sense here. Is it even used? - def add_snippet(self, ft, snippet, filename): + def add_snippet(self, ft, snippet): """Adds the given 'snippet' for 'ft'.""" - self._snippets[ft].add_snippet(snippet, filename) + self._snippets[ft].add_snippet(snippet, None) diff --git a/pythonx/UltiSnips/snippet_manager.py b/pythonx/UltiSnips/snippet_manager.py index 69a3568..a694985 100755 --- a/pythonx/UltiSnips/snippet_manager.py +++ b/pythonx/UltiSnips/snippet_manager.py @@ -169,10 +169,10 @@ class SnippetManager(object): @err_to_scratch_buffer def add_snippet(self, trigger, value, description, - options, ft="all", globals=None, fn=None): + options, ft="all", globals=None): """Add a snippet to the list of known snippets of the given 'ft'.""" self._added_snippets_provider.add_snippet(ft, SnippetDefinition( - trigger, value, description, options, globals or {}), fn + trigger, value, description, options, globals or {}) ) @err_to_scratch_buffer