From 94afc97dd44b93da18e681e265b3c2b8666cd3e6 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 3 Aug 2005 00:00:00 +0200 Subject: stable 2005.08.03 --- scripts/context/ruby/fcd_start.rb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/context/ruby/fcd_start.rb b/scripts/context/ruby/fcd_start.rb index 29e040027..4f8019416 100644 --- a/scripts/context/ruby/fcd_start.rb +++ b/scripts/context/ruby/fcd_start.rb @@ -204,7 +204,7 @@ class FastCD end end - def choose + def choose(args=[]) unless @pattern.empty? then begin case @result.size @@ -214,6 +214,16 @@ class FastCD chdir(@result[0]) else list = @result.dup + begin + if answer = args[1] then + index = answer[0] - ?a + if dir = list[index] then + chdir(dir) + return + end + end + rescue + end loop do print("\n") list.each_index do |i| @@ -228,8 +238,7 @@ class FastCD if answer = wait then if answer >= ?a and answer <= ?z then index = answer - ?a - dir = list[index] - if dir then + if dir = list[index] then print("#{answer.chr} ") chdir(dir) else @@ -248,6 +257,7 @@ class FastCD end end rescue + # report($!) end end end @@ -341,7 +351,7 @@ case action when 30 then fcd.load fcd.find(args) - fcd.choose + fcd.choose(args) when 40 fcd.check end -- cgit v1.2.3