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-10-10 02:48:22 +0200
commitab2265d35945afdee9d4c0d06bf7859157e7b8ce (patch)
treeff093c8d52617aae55eb320476259099cbfdfd63
parent36814777ba720dc4c092becfad7ede98e4e89331 (diff)
downloadranger-ab2265d35945afdee9d4c0d06bf7859157e7b8ce.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:
> 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190