mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Skip indented comment lines [Bug #15981]
This commit is contained in:
parent
0c3e6e86bd
commit
ee861e43f7
2 changed files with 6 additions and 1 deletions
|
@ -119,7 +119,7 @@ class Reline::Config
|
|||
@if_stack = []
|
||||
|
||||
lines.each_with_index do |line, no|
|
||||
next if line.start_with?('#')
|
||||
next if line.match(/\A\s*#/)
|
||||
|
||||
no += 1
|
||||
|
||||
|
|
|
@ -28,6 +28,11 @@ class Reline::Config::Test < Reline::TestCase
|
|||
assert_equal :audible, @config.instance_variable_get(:@bell_style)
|
||||
end
|
||||
|
||||
def test_comment_line
|
||||
@config.read_lines([" #a: error\n"])
|
||||
assert_not_include @config.key_bindings, nil
|
||||
end
|
||||
|
||||
def test_bind_key
|
||||
assert_equal ['input'.bytes, 'abcde'.bytes], @config.bind_key('"input"', '"abcde"')
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue