Merge pull request #679 from SirVer/overwrite-tabstops-from-py-interpolation
Overwrite tabstops from py interpolation
This commit is contained in:
commit
059c9a9da2
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
*.pyc
|
*.pyc
|
||||||
*.swp
|
*.swp
|
||||||
doc/tags
|
doc/tags
|
||||||
|
.ropeproject/
|
||||||
|
@ -28,6 +28,14 @@ class _Tabs(object):
|
|||||||
return ''
|
return ''
|
||||||
return ts.current_text
|
return ts.current_text
|
||||||
|
|
||||||
|
def __setitem__(self, no, value):
|
||||||
|
ts = self._to._get_tabstop(
|
||||||
|
self._to,
|
||||||
|
int(no)) # pylint:disable=protected-access
|
||||||
|
if ts is None:
|
||||||
|
return
|
||||||
|
ts.overwrite(value)
|
||||||
|
|
||||||
_VisualContent = namedtuple('_VisualContent', ['mode', 'text'])
|
_VisualContent = namedtuple('_VisualContent', ['mode', 'text'])
|
||||||
|
|
||||||
|
|
||||||
|
@ -429,6 +429,17 @@ class PythonCode_AccessKilledTabstop_OverwriteFirst(_VimTest):
|
|||||||
keys = 'test' + EX + 'aaa'
|
keys = 'test' + EX + 'aaa'
|
||||||
wanted = 'aaa'
|
wanted = 'aaa'
|
||||||
|
|
||||||
|
class PythonCode_CanOverwriteTabstop(_VimTest):
|
||||||
|
snippets = (
|
||||||
|
'test',
|
||||||
|
"""$1`!p if len(t[1]) > 3 and len(t[2]) == 0:
|
||||||
|
t[2] = t[1][2:];
|
||||||
|
t[1] = t[1][:2] + '-\\n\\t';
|
||||||
|
vim.command('call feedkeys("\<End>", "n")');
|
||||||
|
`$2""")
|
||||||
|
keys = 'test' + EX + 'blah' + ', bah'
|
||||||
|
wanted = "bl-\n\tah, bah"
|
||||||
|
|
||||||
|
|
||||||
class PythonVisual_NoVisualSelection_Ignore(_VimTest):
|
class PythonVisual_NoVisualSelection_Ignore(_VimTest):
|
||||||
snippets = ('test', 'h`!p snip.rv = snip.v.mode + snip.v.text`b')
|
snippets = ('test', 'h`!p snip.rv = snip.v.mode + snip.v.text`b')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user