about summary refs log tree commit diff stats
path: root/ranger/core/actions.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-04-06 03:02:13 +0200
committerhut <hut@lavabit.com>2010-04-06 03:02:13 +0200
commitf9211341cfef720cd7c615655d612b3f489e04f8 (patch)
tree93d00804aaa63576dc3e1621dc818ff6c16c4e85 /ranger/core/actions.py
parent319c55cb0e336d83cbfea03fa94b61bfd91895a2 (diff)
downloadranger-f9211341cfef720cd7c615655d612b3f489e04f8.tar.gz
core.actions: don't jump to first tab when closing the last
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: