From adacb5d0add8605e045ec8968629648196eeb457 Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 2 Oct 2019 00:26:37 +0200 Subject: Deprecate c/p/tunmap in favor of unc/p/tmap `cunmap` definitely won't be missed because it was buggy. I'd expect the other two to be even less missed. I considered writing a decorator for deprecation because the code is repetitive but imo it should be removed in the *next* version after 1.9.3 so it shouldn't matter much. Fixes #1698 --- ranger/config/commands.py | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index e14f0818..c034c457 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1321,29 +1321,63 @@ class unmap(Command): self.fm.ui.keymaps.unbind(self.context, arg) -class cunmap(unmap): - """:cunmap [, ...] +class uncmap(unmap): + """:uncmap [, ...] Remove the given "console" mappings """ context = 'console' +class cunmap(uncmap): + """:cunmap [, ...] -class punmap(unmap): - """:punmap [, ...] + Remove the given "console" mappings + + DEPRECATED in favor of uncmap. + """ + + def execute(self): + self.fm.notify("cunmap is deprecated in favor of uncmap!") + super(cunmap, self).execute() + +class unpmap(unmap): + """:unpmap [, ...] Remove the given "pager" mappings """ context = 'pager' +class punmap(unpmap): + """:punmap [, ...] + + Remove the given "pager" mappings -class tunmap(unmap): - """:tunmap [, ...] + DEPRECATED in favor of unpmap. + """ + + def execute(self): + self.fm.notify("punmap is deprecated in favor of unpmap!") + super(punmap, self).execute() + +class untmap(unmap): + """:untmap [, ...] Remove the given "taskview" mappings """ context = 'taskview' +class tunmap(untmap): + """:tunmap [, ...] + + Remove the given "taskview" mappings + + DEPRECATED in favor of uncmap. + """ + + def execute(self): + self.fm.notify("tunmap is deprecated in favor of untmap!") + super(tunmap, self).execute() + class map_(Command): """:map -- cgit 1.4.1-2-gfad0