summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-09-27 14:38:34 +0200
committerhut <hut@lavabit.com>2010-09-27 14:38:59 +0200
commitb4f09c1a287c23e9474747e5b46bc347b294026a (patch)
tree31890c194afcbc3a40f0901f761d88f32de62e17
parent4d9266ac1fa9f163ce7a9738f07f380ba7e70e45 (diff)
downloadranger-b4f09c1a287c23e9474747e5b46bc347b294026a.tar.gz
core.actions: Minor bug in move_parent()
Unwanted horizontal wrapping when all items in the parent directory
are directories and you're moving below an index of 0.
-rw-r--r--ranger/core/actions.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index b88849ef..a19927a4 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -216,6 +216,8 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 
 	def move_parent(self, n):
 		parent = self.env.at_level(-1)
+		if parent.pointer + n < 0:
+			n = 0 - parent.pointer
 		try:
 			self.env.enter_dir(parent.files[parent.pointer+n])
 		except IndexError:
artik K. Agaram <vc@akkartik.com> 2022-09-03 14:13:22 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2022-09-03 14:13:22 -0700 editing source code from within the app' href='/akkartik/view.love/commit/source_undo.lua?id=e1c5a42f311fdafd88506726bbe480f3fcc2d1a3'>e1c5a42 ^
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