diff options
author | Hans Hagen <pragma@wxs.nl> | 2005-08-03 00:00:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2005-08-03 00:00:00 +0200 |
commit | 94afc97dd44b93da18e681e265b3c2b8666cd3e6 (patch) | |
tree | 6d9d8e05327052c5b177679e9d6902a726bc15f3 /scripts | |
parent | 93e39d7f325f2c6b36851eb87afdce0c902b3078 (diff) | |
download | context-94afc97dd44b93da18e681e265b3c2b8666cd3e6.tar.gz |
stable 2005.08.03
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/ruby/fcd_start.rb | 18 |
1 files changed, 14 insertions, 4 deletions
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 |