summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2014-04-23 20:57:27 +0200
committerhut <hut@lepus.uberspace.de>2014-04-23 20:57:47 +0200
commit3e31022b943f33f0466f9f5b7b452cf2363bfb40 (patch)
tree1e9a0a8e0892f957f6881917b71d1e16590ef9c5 /ranger
parente1a8a76112b7c2b45f4ee389986187fabcd45a2f (diff)
downloadranger-3e31022b943f33f0466f9f5b7b452cf2363bfb40.tar.gz
core.actions: Enhanced :tab_new so you can type 5<C-n>
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 6d4c0474..ec853f1b 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -997,11 +997,12 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
         if newtab != self.current_tab:
             self.tab_open(newtab)
 
-    def tab_new(self, path=None):
+    def tab_new(self, path=None, narg=None):
+        if narg:
+            return self.tab_open(narg, path)
         for i in range(1, 10):
             if not i in self.tabs:
-                self.tab_open(i, path)
-                break
+                return self.tab_open(i, path)
 
     def _get_tab_list(self):
         assert len(self.tabs) > 0, "There must be >=1 tabs at all times"