Skip to content

Commit 84fae34

Browse files
committed
Merge pull request #66 from xbot/master
Fix bug: Remapping won't work for mappings of single modes.
2 parents 1f66ba8 + eee7049 commit 84fae34

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

plugin/python/vdebug/util.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,18 @@ def unmap(self):
5555
for mapping in self.existing:
5656
vdebug.log.Log("Remapping key with '%s' " % mapping,\
5757
vdebug.log.Logger.DEBUG)
58-
vim.command("noremap %s" % mapping)
58+
regex = re.compile(r'\s+')
59+
parts = regex.split(mapping)
60+
mapcmd = 'noremap'
61+
if len(parts)>2:
62+
modeRegex = re.compile(r'^[nvsxoilc!]$')
63+
if modeRegex.match(parts[0]):
64+
mapping = ' '.join(parts[1:])
65+
if parts[0]=='!':
66+
mapcmd = 'noremap!'
67+
else:
68+
mapcmd = '%snoremap' % parts[0]
69+
vim.command("%s %s" % (mapcmd,mapping))
5970

6071
class FilePath:
6172
is_win = False

0 commit comments

Comments
 (0)