Make Snippet object available to SnippetInstance
When a Snippet object creates a SnippetInstance it should pass itself as an argument, so that the instance can later get additional information about the snippet.
This commit is contained in:
parent
18b081b7fe
commit
d4d1e86962
@ -416,7 +416,7 @@ class Snippet(object):
|
|||||||
v.append(line_ind + line[tabs:])
|
v.append(line_ind + line[tabs:])
|
||||||
v = '\n'.join(v)
|
v = '\n'.join(v)
|
||||||
|
|
||||||
si = SnippetInstance(parent, indent, v, start, end, visual_content,
|
si = SnippetInstance(self, parent, indent, v, start, end, visual_content,
|
||||||
last_re = self._last_re, globals = self._globals)
|
last_re = self._last_re, globals = self._globals)
|
||||||
|
|
||||||
return si
|
return si
|
||||||
|
@ -15,12 +15,12 @@ class SnippetInstance(EditableTextObject):
|
|||||||
also a TextObject because it has a start an end
|
also a TextObject because it has a start an end
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, parent, indent, initial_text, start, end, visual_content, last_re, globals):
|
def __init__(self, snippet, parent, indent, initial_text, start, end, visual_content, last_re, globals):
|
||||||
if start is None:
|
if start is None:
|
||||||
start = Position(0,0)
|
start = Position(0,0)
|
||||||
if end is None:
|
if end is None:
|
||||||
end = Position(0,0)
|
end = Position(0,0)
|
||||||
|
self.snippet = snippet
|
||||||
self._cts = 0
|
self._cts = 0
|
||||||
|
|
||||||
self.locals = {"match" : last_re}
|
self.locals = {"match" : last_re}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user