summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/actions.py4
-rw-r--r--ranger/fsobject/directory.py4
2 files changed, 5 insertions, 3 deletions
diff --git a/ranger/actions.py b/ranger/actions.py
index 0d8472cd..9b877e71 100644
--- a/ranger/actions.py
+++ b/ranger/actions.py
@@ -13,6 +13,7 @@ class Actions(EnvironmentAware, SettingsAware):
 	search_forward = False
 
 	def search(self, order=None, forward=True):
+		original_order = order
 		if self.search_forward:
 			direction = bool(forward)
 		else:
@@ -39,7 +40,7 @@ class Actions(EnvironmentAware, SettingsAware):
 
 		elif order in ('size', 'mimetype', 'ctime'):
 			pwd = self.env.pwd
-			if not pwd.cycle_list:
+			if original_order is not None:
 				lst = list(pwd.files)
 				if order == 'size':
 					fnc = lambda item: item.size
@@ -49,6 +50,7 @@ class Actions(EnvironmentAware, SettingsAware):
 					fnc = lambda item: -int(item.stat and item.stat.st_ctime)
 				lst.sort(key=fnc)
 				pwd.set_cycle_list(lst)
+				return pwd.cycle(forward=None)
 
 			return pwd.cycle(forward=forward)
 
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index 71afa06a..5ff768fb 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -283,9 +283,9 @@ class Directory(FileSystemObject, Accumulator, SettingsAware):
 
 	def cycle(self, forward=True):
 		if self.cycle_list:
-			if forward:
+			if forward is True:
 				self.cycle_list.rotate(-1)
-			else:
+			elif forward is False:
 				self.cycle_list.rotate(1)
 
 			self.move_to_obj(self.cycle_list[0])
13 17:57:46 +0200 dirarg: added unit test and almost working implementaiton' href='/akspecs/ranger/commit/test/tc_direction.py?h=v1.1.0&id=447cbcd65588eafdb85b407750602c0fdd591ef4'>447cbcd6 ^
76e9b89a ^
447cbcd6 ^
7a2665c2 ^


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