about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--code/directory.rb2
-rw-r--r--code/draw.rb6
2 files changed, 5 insertions, 3 deletions
diff --git a/code/directory.rb b/code/directory.rb
index e7431399..d00a2eb6 100644
--- a/code/directory.rb
+++ b/code/directory.rb
@@ -57,6 +57,7 @@ class Directory
 	end
 	def self.filter() @@filter end
 
+	def schedule_resort() @sort_time = BAD_TIME end
 	def scheduled?() @scheduled end
 	def read?() @read end
 
@@ -159,6 +160,7 @@ class Directory
 			@file_size += f.size if f.file?
 		end
 		@read = true
+		schedule_resort
 	end
 
 #	def refresh()
diff --git a/code/draw.rb b/code/draw.rb
index 43f2b8e1..e8a1ccdc 100644
--- a/code/draw.rb
+++ b/code/draw.rb
@@ -66,8 +66,6 @@ module Fm
 
 			break if (f = d.files[lpo]) == nil
 
-			d.sort_if_needed
-
 			mycolor = if lpo == d.pos
 				if infos
 					Color.selected_current_row
@@ -254,7 +252,9 @@ module Fm
 			begin
 				if Option.preview
 					if cf.dir?
-						put_directory(3, @dirs[cf.path])
+						dir = @dirs[ cf.path ]
+						dir.sort_if_needed
+						put_directory(3, dir)
 					elsif cf.file?
 						column_put_file(3, cf)
 					else