Skip indented comment lines [Bug #15981]

This commit is contained in:
Nobuyoshi Nakada 2019-07-04 18:46:34 +09:00
Родитель 0c3e6e86bd
Коммит ee861e43f7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4BC7D6DF58D8DF60
2 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -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