summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/actions.py7
-rw-r--r--ranger/core/tab.py2
2 files changed, 6 insertions, 3 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index b7205dc5..24b115de 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -838,6 +838,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 	def tab_open(self, name, path=None):
 		tab_has_changed = (name != self.current_tab)
 		self.current_tab = name
+		previous_tab = self.thistab
 		try:
 			tab = self.tabs[name]
 		except KeyError:
@@ -851,7 +852,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 
 		if tab_has_changed:
 			self.change_mode('normal')
-			self.signal_emit('tab.change')
+			self.signal_emit('tab.change', old=previous_tab, new=self.thistab)
 
 	def tab_close(self, name=None):
 		if name is None:
@@ -869,6 +870,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 
 	def tab_restore(self):
 		# NOTE: The name of the tab is not restored.
+		previous_tab = self.thistab
 		if self.restorable_tabs:
 			tab = self.restorable_tabs.pop()
 			for name in range(1, len(self.tabs) + 2):
@@ -878,7 +880,8 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 					tab.enter_dir(tab.path)
 					self.thistab = tab
 					self.change_mode('normal')
-					self.signal_emit('tab.change')
+					self.signal_emit('tab.change', old=previous_tab,
+							new=self.thistab)
 					break
 
 	def tab_move(self, offset):
diff --git a/ranger/core/tab.py b/ranger/core/tab.py
index 0244adec..e5605f28 100644
--- a/ranger/core/tab.py
+++ b/ranger/core/tab.py
@@ -28,7 +28,7 @@ class Tab(FileManagerAware, SettingsAware):
 				self.pointer = self.thisdir.pointer
 
 	def _on_tab_change(self, signal):
-		if self == self.fm.thistab and self.thisdir:
+		if self == signal.new and self.thisdir:
 			# restore the pointer whenever this tab is reopened
 			self.thisdir.pointer = self.pointer
 			self.thisdir.correct_pointer()
rk' href='/akspecs/ranger/commit/doc/colorschemes.txt?h=v1.9.2&id=efdc7b16e9f422f2d95271e6d4bf64dd9a03ea33'>efdc7b16 ^
a2853ab6 ^
f597489c ^
efdc7b16 ^
29b05d00 ^


efdc7b16 ^
f597489c ^


efdc7b16 ^

a8f9cf2c ^

efdc7b16 ^






f597489c ^
efdc7b16 ^




23905709 ^
efdc7b16 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92