Exemplo n.º 1
0
 def __init__(self, parent):
     NoneditableTextObject.__init__(
         self,
         parent,
         _vim.buf.cursor,
         _vim.buf.cursor,
         tiebreaker=Position(0, 0),
     )
Exemplo n.º 2
0
    def __init__(self, parent, token):
        # Find our containing snippet for visual_content
        snippet = parent
        while snippet:
            try:
                self._text = snippet.visual_content.text
                self._mode = snippet.visual_content.mode
                break
            except AttributeError:
                snippet = snippet._parent
        if not self._text:
            self._text = token.alternative_text
            self._mode = "v"

        NoneditableTextObject.__init__(self, parent, token)
Exemplo n.º 3
0
    def __init__(self, parent, token):
        # Find our containing snippet for visual_content
        snippet = parent
        while snippet:
            try:
                self._text = snippet.visual_content.text
                self._mode = snippet.visual_content.mode
                break
            except AttributeError:
                snippet = snippet._parent
        if not self._text:
            self._text = token.alternative_text
            self._mode = "v"

        NoneditableTextObject.__init__(self, parent, token)
        TextObjectTransformation.__init__(self, token)
Exemplo n.º 4
0
    def __init__(self, parent, token):
        # Find our containing snippet for visual_content
        snippet = parent
        while snippet:
            try:
                self._text = snippet.visual_content.text
                self._mode = snippet.visual_content.mode
                break
            except AttributeError:
                snippet = snippet._parent  # pylint:disable=protected-access
        if not self._text:
            self._text = token.alternative_text
            self._mode = "v"

        NoneditableTextObject.__init__(self, parent, token)
        TextObjectTransformation.__init__(self, token)
Exemplo n.º 5
0
    def __init__(self, parent, token):

        # Find our containing snippet for snippet local data
        snippet = parent
        while snippet:
            try:
                self._locals = snippet.locals
                text = snippet.visual_content.text
                mode = snippet.visual_content.mode
                break
            except AttributeError:
                snippet = snippet._parent  # pylint:disable=protected-access
        self._snip = SnippetUtil(token.indent, mode, text)

        self._codes = (('import re, os, vim, string, random', '\n'.join(
            snippet.globals.get('!p', [])).replace('\r\n', '\n'),
                        token.code.replace('\\`', '`')))
        NoneditableTextObject.__init__(self, parent, token)
Exemplo n.º 6
0
    def __init__(self, parent, token):

        # Find our containing snippet for snippet local data
        snippet = parent
        while snippet:
            try:
                self._locals = snippet.locals
                text = snippet.visual_content.text
                mode = snippet.visual_content.mode
                break
            except AttributeError:
                snippet = snippet._parent  # pylint:disable=protected-access
        self._snip = SnippetUtil(token.indent, mode, text)

        self._codes = ((
            "import re, os, vim, string, random",
            "\n".join(snippet.globals.get("!p", [])).replace("\r\n", "\n"),
            token.code.replace("\\`", "`")
        ))
        NoneditableTextObject.__init__(self, parent, token)
Exemplo n.º 7
0
    def __init__(self, parent, token):

        # Find our containing snippet for snippet local data
        snippet = parent
        while snippet:
            try:
                self._locals = snippet.locals
                text = snippet.visual_content.text
                mode = snippet.visual_content.mode
                context = snippet.context
                break
            except AttributeError as e:
                snippet = snippet._parent  # pylint:disable=protected-access
        self._snip = SnippetUtil(token.indent, mode, text, context, snippet)

        self._codes = ((
            'import re, os, vim, string, random',
            '\n'.join(snippet.globals.get('!p', [])).replace('\r\n', '\n'),
            token.code.replace('\\`', '`')
        ))
        NoneditableTextObject.__init__(self, parent, token)
Exemplo n.º 8
0
    def __init__(self, parent, token):
        code = token.code.replace("\\`", "`")

        # Find our containing snippet for snippet local data
        snippet = parent
        while snippet:
            try:
                self._locals = snippet.locals
                break
            except AttributeError:
                snippet = snippet._parent
        self._snip = SnippetUtil(token.indent)

        self._globals = {}
        globals = snippet.globals.get("!p", [])
        compatible_exec("\n".join(globals).replace("\r\n", "\n"), self._globals)

        # Add Some convenience to the code
        self._code = "import re, os, vim, string, random\n" + code

        NoneditableTextObject.__init__(self, parent, token)
Exemplo n.º 9
0
    def __init__(self, parent, token):
        code = token.code.replace("\\`", "`")

        # Find our containing snippet for snippet local data
        snippet = parent
        while snippet:
            try:
                self._locals = snippet.locals
                t = snippet.visual_content.text
                m = snippet.visual_content.mode
                break
            except AttributeError:
                snippet = snippet._parent
        self._snip = SnippetUtil(token.indent, m, t)

        self._globals = {}
        globals = snippet.globals.get("!p", [])
        compatible_exec("\n".join(globals).replace("\r\n", "\n"), self._globals)

        # Add Some convenience to the code
        self._code = "import re, os, vim, string, random\n" + code

        NoneditableTextObject.__init__(self, parent, token)
Exemplo n.º 10
0
    def __init__(self, parent, token):
        self._code = token.code.replace("\\`", "`").strip()

        NoneditableTextObject.__init__(self, parent, token)
Exemplo n.º 11
0
    def __init__(self, parent, token):
        self._code = token.code.replace("\\`", "`").strip()

        NoneditableTextObject.__init__(self, parent, token)
Exemplo n.º 12
0
    def __init__(self, parent, tabstop, token):
        NoneditableTextObject.__init__(self, parent, token)

        self._ts = tabstop
Exemplo n.º 13
0
 def __init__(self, parent, token):
     NoneditableTextObject.__init__(self, parent, token)
     self._code = token.code.replace("\\`", "`")
     self._tmpdir = _get_tmp()
 def __init__(self, parent):
     NoneditableTextObject.__init__(
         self, parent, _vim.buf.cursor, _vim.buf.cursor,
         tiebreaker=Position(-1, -1))
Exemplo n.º 15
0
 def __init__(self, parent, token):
     NoneditableTextObject.__init__(self, parent, token)
     self._code = token.code.replace('\\`', '`')
     self._tmpdir = _get_tmp()
Exemplo n.º 16
0
 def __init__(self, parent, tabstop, token):
     NoneditableTextObject.__init__(self, parent, token)
     self._ts = tabstop