summary refs log tree commit diff stats
path: root/ranger/core/actions.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/core/actions.py')
-rw-r--r--ranger/core/actions.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 877c300e..e2dfd837 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -439,8 +439,9 @@ class Actions(EnvironmentAware, SettingsAware):
 		if name is None:
 			name = self.current_tab
 		if name == self.current_tab:
+			direction = -1 if name == self._get_tab_list()[-1] else 1
 			previous = self.current_tab
-			self.tab_move(1)
+			self.tab_move(direction)
 			if previous == self.current_tab:
 				return  # can't close last tab
 		if name in self.tabs: