summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/loader.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/ranger/core/loader.py b/ranger/core/loader.py
index f1be697a..4437d028 100644
--- a/ranger/core/loader.py
+++ b/ranger/core/loader.py
@@ -339,12 +339,16 @@ class Loader(FileManagerAware):
 			if item.progressbar_supported:
 				self.fm.ui.status.request_redraw()
 		except StopIteration:
-			item.load_generator = None
-			self.queue.remove(item)
-			if item.progressbar_supported:
-				self.fm.ui.status.request_redraw()
+			self._remove_current_process(item)
 		except Exception as err:
 			self.fm.notify(err)
+			self._remove_current_process(item)
+
+	def _remove_current_process(self, item):
+		item.load_generator = None
+		self.queue.remove(item)
+		if item.progressbar_supported:
+			self.fm.ui.status.request_redraw()
 
 	def has_work(self):
 		"""Is there anything to load?"""