about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/container/history.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/ranger/container/history.py b/ranger/container/history.py
index 355c7c72..80fe8b4a 100644
--- a/ranger/container/history.py
+++ b/ranger/container/history.py
@@ -29,7 +29,7 @@ class History(object):
 
 	def top(self):
 		try:
-			return self.history_forward[0]
+			return self.history_forward[-1]
 		except IndexError:
 			try:
 				return self.history[-1]
@@ -44,7 +44,7 @@ class History(object):
 
 	def back(self):
 		if len(self.history) > 1:
-			self.history_forward.append( self.history.pop() )
+			self.history_forward.appendleft( self.history.pop() )
 		return self.current()
 
 	def move(self, n):
@@ -61,7 +61,7 @@ class History(object):
 
 	def forward(self):
 		if len(self.history_forward) > 0:
-			self.history.append( self.history_forward.pop() )
+			self.history.append( self.history_forward.popleft() )
 		return self.current()
 
 	def fast_forward(self):