Do not pass filename to UltiSnips#AddSnippet.
This commit is contained in:
parent
2eb82d127b
commit
991609e461
@ -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*
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user