diff options
-rw-r--r-- | lib/irb/color.rb | 2 | ||||
-rw-r--r-- | test/irb/test_color.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/irb/color.rb b/lib/irb/color.rb index 2439bc792e..51facaa476 100644 --- a/lib/irb/color.rb +++ b/lib/irb/color.rb @@ -136,7 +136,7 @@ module IRB # :nodoc: case token when :on_symbeg @stack << true - when :on_ident, :on_op, :on_const, :on_ivar + when :on_ident, :on_op, :on_const, :on_ivar, :on_kw if @stack.last # Pop only when it's Symbol @stack.pop return prev_state diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb index eb30840bf1..3ba0c4c1ac 100644 --- a/test/irb/test_color.rb +++ b/test/irb/test_color.rb @@ -49,6 +49,7 @@ module TestIRB "[__FILE__, __LINE__]" => "[#{CYAN}#{BOLD}__FILE__#{CLEAR}, #{CYAN}#{BOLD}__LINE__#{CLEAR}]", ":self" => "#{YELLOW}:#{CLEAR}#{YELLOW}self#{CLEAR}", ":class" => "#{YELLOW}:#{CLEAR}#{YELLOW}class#{CLEAR}", + "[:end, 2]" => "[#{YELLOW}:#{CLEAR}#{YELLOW}end#{CLEAR}, #{BLUE}#{BOLD}2#{CLEAR}]", "[:>, 3]" => "[#{YELLOW}:#{CLEAR}#{YELLOW}>#{CLEAR}, #{BLUE}#{BOLD}3#{CLEAR}]", ":Hello ? world : nil" => "#{YELLOW}:#{CLEAR}#{YELLOW}Hello#{CLEAR} ? world : #{CYAN}#{BOLD}nil#{CLEAR}", 'raise "foo#{bar}baz"' => "raise #{RED}\"#{CLEAR}#{RED}foo#{CLEAR}#{RED}\#{#{CLEAR}bar#{RED}}#{CLEAR}#{RED}baz#{CLEAR}#{RED}\"#{CLEAR}", |