summary refs log tree commit diff stats
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2019-10-02 00:26:37 +0200
committertoonn <toonn@toonn.io>2019-10-02 21:01:47 +0200
commitadacb5d0add8605e045ec8968629648196eeb457 (patch)
tree9261b3f4a0512fd7396dfa53e1938eb59a6a0d4d
parentd674b457082ac878e525e63549ad0d7500bcb0b3 (diff)
downloadranger-adacb5d0add8605e045ec8968629648196eeb457.tar.gz
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
-rwxr-xr-xranger/config/commands.py46
1 files 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 <keys> [<keys2>, ...]
+class uncmap(unmap):
+    """:uncmap <keys> [<keys2>, ...]
 
     Remove the given "console" mappings
     """
     context = 'console'
 
+class cunmap(uncmap):
+    """:cunmap <keys> [<keys2>, ...]
 
-class punmap(unmap):
-    """:punmap <keys> [<keys2>, ...]
+    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 <keys> [<keys2>, ...]
 
     Remove the given "pager" mappings
     """
     context = 'pager'
 
+class punmap(unpmap):
+    """:punmap <keys> [<keys2>, ...]
+
+    Remove the given "pager" mappings
 
-class tunmap(unmap):
-    """:tunmap <keys> [<keys2>, ...]
+    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 <keys> [<keys2>, ...]
 
     Remove the given "taskview" mappings
     """
     context = 'taskview'
 
+class tunmap(untmap):
+    """:tunmap <keys> [<keys2>, ...]
+
+    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 <keysequence> <command>