mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/irb/completion.rb (CompletionProc): irb will be stuck with
long variable name at copletion. [Bug#1969]. refix [ruby-core:28366]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8a3c3b9c95
commit
c13142643d
2 changed files with 11 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
Fri Apr 9 21:22:10 2010 Keiju Ishitsuka <keiju@ruby-lang.org>
|
||||
|
||||
* 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@ruby-lang.org>
|
||||
|
||||
* lib/uri/common.rb (decode_www_form): don't ignore leading '?'.
|
||||
|
|
|
@ -80,7 +80,8 @@ module IRB
|
|||
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 @@ module IRB
|
|||
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 @@ module IRB
|
|||
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}
|
||||
|
|
Loading…
Reference in a new issue