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.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index d52dac2b..b40febc8 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -428,12 +428,15 @@ class Actions(EnvironmentAware, SettingsAware):
 	def _get_tab_list(self):
 		return sorted(self.tabs)
 
-	def tab_open(self, name):
-		if name in self.tabs:
-			self.current_tab = name
-			self.enter_dir(self.tabs[name], remember=False)
+	def tab_open(self, name, path=None):
+		do_emit_signal = name != self.current_tab
+		self.current_tab = name
+		if path or (name in self.tabs):
+			self.enter_dir(path or self.tabs[name])
 		else:
-			self.tab_new(name)
+			self._update_current_tab()
+		if do_emit_signal:
+			self.signal_emit('tab.change')
 
 	def tab_close(self, name=None):
 		if name is None:
@@ -454,12 +457,12 @@ class Actions(EnvironmentAware, SettingsAware):
 		if newtab != self.current_tab:
 			self.tab_open(newtab)
 
-	def tab_new(self, name, path=None):
-		self.current_tab = name
-		if path:
-			self.enter_dir(path, remember=False)
-		else:
-			self._update_current_tab()
+	def tab_new(self):
+		for i in range(10):
+			i = (i + 1) % 10
+			if not i in self.tabs:
+				self.tab_open(i)
+				break
 
 	def _update_current_tab(self):
 		self.tabs[self.current_tab] = self.env.cwd.path
6a8d47e39dcecf785183e5'>^
06cffd8 ^

06cffd8 ^
45d6723 ^

c5cf0e1 ^
cf6c849 ^
8630499 ^
cf6c849 ^
69217dd ^


a0be15e ^

cd635e6 ^
06cffd8 ^

d083ce6 ^
06cffd8 ^
bd23ef0 ^

887c25e ^
bd23ef0 ^
e34697c ^
920306c ^
efa99ed ^

7410b8c ^



df1d1ef ^
4695425 ^
2b0d4a5 ^
6c1b09b ^











6753171 ^



f2d85b6 ^
1f8b2ce ^
06cffd8 ^
06cffd8 ^
c896e6b ^
71971db ^
e34697c ^
5310d08 ^
7410b8c ^
06cffd8 ^

f2d85b6 ^
1f8b2ce ^
f2d85b6 ^




bd23ef0 ^

f2d85b6 ^
67864b2 ^
cf6c849 ^





f2d85b6 ^

5310d08 ^







5310d08 ^
cfda931 ^
cd635e6 ^
cd635e6 ^
887c25e ^
b29e1c1 ^
887c25e ^

887c25e ^
78f4d8a ^


c896e6b ^

cd635e6 ^
d083ce6 ^
5310d08 ^

cd635e6 ^
b29e1c1 ^
d083ce6 ^
efa99ed ^

c896e6b ^
5310d08 ^



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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128