Shortened the variable name, and added documentation.
This commit is contained in:
parent
8f7cdb9c69
commit
52be5df6ef
@ -29,7 +29,7 @@ ts = '\t'
|
||||
if vim.eval("&expandtab") == 1:
|
||||
ts = " " * int(vim.eval("&ts"))
|
||||
|
||||
indent = initial_indent + ts * 2
|
||||
indent = ind + ts * 2
|
||||
args = [arg.split('=')[0].strip() for arg in t[4].split(',') if arg]
|
||||
args = [arg for arg in args if arg and arg != "self"]
|
||||
|
||||
@ -64,7 +64,7 @@ args = [arg for arg in args if arg and arg != "self"]
|
||||
|
||||
if args:
|
||||
res += '\n'
|
||||
indent = initial_indent + ts
|
||||
indent = ind + ts
|
||||
for arg in args:
|
||||
res += indent + ":%s: description\n" % arg
|
||||
`
|
||||
|
@ -271,6 +271,7 @@ can be used: >
|
||||
t - The values of the placeholders, t[1] -> current text of ${1} and so on
|
||||
cur - The current text of the placeholder. You can check if this is != ""
|
||||
to make sure that the interpolation is only done once
|
||||
ind - The indentation text appearing before the first line of the snippet
|
||||
|
||||
Also, the vim, re, os, string and random modules are already imported inside
|
||||
the snippet code. This allows for very flexible snippets. For example, the
|
||||
|
@ -728,7 +728,7 @@ class PythonCode(TextObject):
|
||||
'path': path,
|
||||
'cur': ct,
|
||||
'res': ct,
|
||||
'initial_indent': self._indent
|
||||
'ind': self._indent
|
||||
}
|
||||
|
||||
exec self._code in d
|
||||
|
Loading…
Reference in New Issue
Block a user