about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-07-20 22:21:05 +0200
committerhut <hut@lavabit.com>2009-07-20 22:21:05 +0200
commit6172a793e21e4629cb1167a1b2e095bc9156c688 (patch)
treefa5f92994eced7e16cc8534b8ef7ef88cdbc277c
parent0b5197ecec8d0b890c78caf92527e260890da5a3 (diff)
downloadranger-6172a793e21e4629cb1167a1b2e095bc9156c688.tar.gz
made sure you stay at the same file on Directory.refresh
-rw-r--r--code/directory.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/code/directory.rb b/code/directory.rb
index ef4f1ba6..ab636b0b 100644
--- a/code/directory.rb
+++ b/code/directory.rb
@@ -182,6 +182,8 @@ class Directory
 #		end
 #	end
 	def refresh(info=false)
+		oldfile = @pointed_file
+
 		if File.mtime(@path) != @mtime
 			read_dir
 		end
@@ -190,6 +192,10 @@ class Directory
 			get_file_info 
 		end
 		sort_if_needed
+
+		if @files.include? oldfile
+			self.pointed_file = oldfile
+		end
 	end
 
 	def schedule()