about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorThiago Perrotta <tbperrotta@gmail.com>2021-08-14 20:38:34 -0400
committerThiago Perrotta <tbperrotta@gmail.com>2021-08-14 20:45:08 -0400
commitc36af8550f7830f3d242e022e891455548214d7e (patch)
treed8c50f6e34918af09c8ca78d82b7d6ff103b88cb
parent236b8f6a9dd4f3e26021c52324bf1db7ef5e1af4 (diff)
downloadranger-c36af8550f7830f3d242e022e891455548214d7e.tar.gz
Make tab command names consistent with vim, closes #2412
tabnew proxies to tab_new, tabclose proxies to tab_close, and so on.

Both forms (with and without underscore) remain available, the
underscore being the canonical ones.
-rw-r--r--ranger/core/actions.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 6b184236..594ce29d 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -1245,6 +1245,9 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
             self.signal_emit('tab.change', old=previous_tab, new=self.thistab)
             self.signal_emit('tab.layoutchange')
 
+    def tabopen(self, *args, **kwargs):
+        return self.tab_open(*args, **kwargs)
+
     def tab_close(self, name=None):
         if name is None:
             name = self.current_tab
@@ -1260,6 +1263,9 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
         self.restorable_tabs.append(tab)
         self.signal_emit('tab.layoutchange')
 
+    def tabclose(self, *args, **kwargs):
+        return self.tab_close(*args, **kwargs)
+
     def tab_restore(self):
         # NOTE: The name of the tab is not restored.
         previous_tab = self.thistab
@@ -1275,6 +1281,9 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
                     self.signal_emit('tab.change', old=previous_tab, new=self.thistab)
                     break
 
+    def tabrestore(self, *args, **kwargs):
+        return self.tab_restore(*args, **kwargs)
+
     def tab_move(self, offset, narg=None):
         if narg:
             return self.tab_open(narg)
@@ -1286,6 +1295,9 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
             self.tab_open(newtab)
         return None
 
+    def tabmove(self, *args, **kwargs):
+        return self.tab_move(*args, **kwargs)
+
     def tab_new(self, path=None, narg=None):
         if narg:
             return self.tab_open(narg, path)
@@ -1294,6 +1306,9 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
             i += 1
         return self.tab_open(i, path)
 
+    def tabnew(self, *args, **kwargs):
+        return self.tab_new(*args, **kwargs)
+
     def tab_shift(self, offset=0, to=None):  # pylint: disable=invalid-name
         """Shift the tab left/right
 
@@ -1340,6 +1355,9 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
             self.ui.titlebar.request_redraw()
             self.signal_emit('tab.layoutchange')
 
+    def tabshift(self, *args, **kwargs):
+        return self.tab_shift(*args, **kwargs)
+
     def tab_switch(self, path, create_directory=False):
         """Switches to tab of given path, opening a new tab as necessary.
 
@@ -1384,6 +1402,9 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
         if file_selection:
             self.fm.select_file(file_selection)
 
+    def tabswitch(self, *args, **kwargs):
+        return self.tab_switch(*args, **kwargs)
+
     def get_tab_list(self):
         assert self.tabs, "There must be at least 1 tab at all times"