[前][次][番号順一覧][スレッド一覧]

ruby-changes:15379

From: keiju <ko1@a...>
Date: Fri, 9 Apr 2010 21:28:15 +0900 (JST)
Subject: [ruby-changes:15379] Ruby:r27271 (trunk): * lib/irb/completion.rb (CompletionProc): irb will be stuck with

keiju	2010-04-09 21:28:00 +0900 (Fri, 09 Apr 2010)

  New Revision: 27271

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27271

  Log:
    * lib/irb/completion.rb (CompletionProc): irb will be stuck with
       long variable name at copletion. [Bug#1969]. refix [ruby-core:28366].

  Modified files:
    trunk/ChangeLog
    trunk/lib/irb/completion.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 27270)
+++ ChangeLog	(revision 27271)
@@ -1,3 +1,8 @@
+Fri Apr  9 21:22:10 2010  Keiju Ishitsuka  <keiju@r...>
+
+	* lib/irb/completion.rb (CompletionProc): irb will be stuck with
+	  long variable name at copletion. [Bug#1969]. refix [ruby-core:28366].
+
 Fri Apr  9 20:54:10 2010  NARUSE, Yui  <naruse@r...>
 
 	* lib/uri/common.rb (decode_www_form): don't ignore leading '?'.
Index: lib/irb/completion.rb
===================================================================
--- lib/irb/completion.rb	(revision 27270)
+++ lib/irb/completion.rb	(revision 27271)
@@ -80,7 +80,8 @@
 	candidates = Object.constants.collect{|m| m.to_s}
 	candidates.grep(/^#{receiver}/).collect{|e| "::" + e}
 
-      when /^(((::)?[A-Z][^:.\(]*)+)::?([^:.]*)$/
+#      when /^(((::)?[A-Z][^:.\(]*)+)::?([^:.]*)$/
+      when /^([A-Z].*)::([^:.]+)*$/
 	# Constant or class methods
 	receiver = $1
 	message = Regexp.quote($4)
@@ -129,7 +130,8 @@
 	candidates = global_variables.collect{|m| m.to_s}.grep(regmessage)
 
 #      when /^(\$?(\.?[^.]+)+)\.([^.]*)$/
-      when /^((\.?[^.]+)+)\.([^.]*)$/
+#      when /^((\.?[^.]+)+)\.([^.]*)$/
+      when /^([^."].*)\.([^.]*)$/
 	# variable
 	receiver = $1
 	message = Regexp.quote($3)
@@ -138,7 +140,8 @@
 	lv = eval("local_variables", bind).collect{|m| m.to_s}
 	cv = eval("self.class.constants", bind).collect{|m| m.to_s}
 
-	if (gv | lv | cv).include?(receiver) || /^[A-Z]/ =~ receiver and /\./ !~ receiver
+	if (gv | lv | cv).include?(receiver) or /^[A-Z]/ =~ receiver && /\./ !~ receiver
+	  # foo.func and foo is local var. OR
 	  # Foo::Bar.func
 	  begin
 	    candidates = eval("#{receiver}.methods", bind).collect{|m| m.to_s}

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]