コード例 #1
0
ファイル: snippet_instance.py プロジェクト: Mike-ja/ultisnips
    def __init__(
        self,
        snippet,
        parent,
        initial_text,
        start,
        end,
        visual_content,
        last_re,
        globals,
        context,
    ):
        if start is None:
            start = Position(0, 0)
        if end is None:
            end = Position(0, 0)
        self.snippet = snippet
        self._cts = 0

        self.context = context
        self.locals = {"match": last_re, "context": context}
        self.globals = globals
        self.visual_content = visual_content
        self.current_placeholder = None

        EditableTextObject.__init__(self, parent, start, end, initial_text)
コード例 #2
0
 def __init__(self, parent, token, start=None, end=None):
     if start is not None:
         self._number = token
         EditableTextObject.__init__(self, parent, start, end)
     else:
         self._number = token.number
         EditableTextObject.__init__(self, parent, token)
     parent._tabstops[self._number] = self  # pylint:disable=protected-access
コード例 #3
0
ファイル: snippet_instance.py プロジェクト: Mike-ja/ultisnips
 def _get_tabstop(self, requester, no):
     # SnippetInstances are completely self contained, therefore, we do not
     # need to ask our parent for Tabstops
     cached_parent = self._parent
     self._parent = None
     rv = EditableTextObject._get_tabstop(self, requester, no)
     self._parent = cached_parent
     return rv