Permalink
Browse files

Fix bug: Remapping won't work for mappings of single modes. See ':h m…

…ap-listing' for more info.
  • Loading branch information...
1 parent 699ab0e commit c93985482c8b14148e7062713b08dba7a31eb376 @xbot xbot committed Mar 21, 2013
Showing with 12 additions and 1 deletion.
  1. +12 −1 plugin/python/vdebug/util.py
@@ -55,7 +55,18 @@ def unmap(self):
for mapping in self.existing:
vdebug.log.Log("Remapping key with '%s' " % mapping,\
vdebug.log.Logger.DEBUG)
- vim.command("noremap %s" % mapping)
+ regex = re.compile(r'\s+')
+ parts = regex.split(mapping)
+ mapcmd = 'noremap'
+ if len(parts)>2:
+ modeRegex = re.compile(r'^[nvsxoilc!]$')
+ if modeRegex.match(parts[0]):
+ mapping = ' '.join(parts[1:])
+ if parts[0]=='!':
+ mapcmd = 'noremap!'
+ else:
+ mapcmd = '%snoremap' % parts[0]
+ vim.command("%s %s" % (mapcmd,mapping))
class FilePath:
is_win = False

0 comments on commit c939854

Please sign in to comment.