summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/irb/completion.rb2
-rw-r--r--test/irb/test_completion.rb2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb
index 97f97dfafe..b3b2ecf924 100644
--- a/lib/irb/completion.rb
+++ b/lib/irb/completion.rb
@@ -215,7 +215,7 @@ module IRB
select_message(receiver, message, proc_candidates | hash_candidates)
end
- when /^(:[^:.]*)$/
+ when /^(:[^:.]+)$/
# Symbol
if doc_namespace
nil
diff --git a/test/irb/test_completion.rb b/test/irb/test_completion.rb
index b93b5e804a..c909b143a4 100644
--- a/test/irb/test_completion.rb
+++ b/test/irb/test_completion.rb
@@ -292,6 +292,8 @@ module TestIRB
_ = :aiueo
assert_include(IRB::InputCompletor.retrieve_completion_data(":a", bind: binding), ":aiueo")
assert_empty(IRB::InputCompletor.retrieve_completion_data(":irb_unknown_symbol_abcdefg", bind: binding))
+ # Do not complete empty symbol for performance reason
+ assert_empty(IRB::InputCompletor.retrieve_completion_data(":", bind: binding))
end
def test_complete_invalid_three_colons