diff options
Diffstat (limited to 'ranger/core/actions.py')
-rw-r--r-- | ranger/core/actions.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 6bbb35aa..a3aad746 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -1186,10 +1186,10 @@ class Actions( # pylint: disable=too-many-instance-attributes,too-many-public-m def tab_new(self, path=None, narg=None): if narg: return self.tab_open(narg, path) - for i in range(1, 10): - if i not in self.tabs: - return self.tab_open(i, path) - return None + i = 1 + while i in self.tabs: + i += 1 + return self.tab_open(i, path) def tab_switch(self, path, create_directory=False): """Switches to tab of given path, opening a new tab as necessary. |