MCPcopy Create free account
hub / github.com/SirVer/ultisnips / _Tabs

Class _Tabs

pythonx/UltiSnips/text_objects/python_code.py:23–40  ·  view source on GitHub ↗

Allows access to tabstop content via t[] inside of python code.

Source from the content-addressed store, hash-verified

21
22
23class _Tabs:
24 """Allows access to tabstop content via t[] inside of python code."""
25
26 def __init__(self, to):
27 self._to = to
28
29 def __getitem__(self, no):
30 ts = self._to._get_tabstop(self._to, int(no))
31 if ts is None:
32 return ""
33 return ts.current_text
34
35 def __setitem__(self, no, value):
36 ts = self._to._get_tabstop(self._to, int(no))
37 if ts is None:
38 return
39 # TODO(sirver): The buffer should be passed into the object on construction.
40 ts.overwrite(vim_helper.buf, value)
41
42
43class _VisualContent(NamedTuple):

Callers 1

_updateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected