diff options
author | tomoya ishida <tomoyapenguin@gmail.com> | 2023-02-27 19:21:25 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-02-27 10:21:30 +0000 |
commit | 4f611df3f7f61fbdf83b02121dd1edea0b7c68ec (patch) | |
tree | 687cdd4b697f08a62bd2c7be04fa83a16f322c16 /test/reline/yamatanooroti/multiline_repl | |
parent | 2cbe1f3ebc15e5adf5ea68b9371a16a2d26724b3 (diff) |
[ruby/reline] Fix wrong indent number in prompt. whole_lines has
duplicated line.
(https://github.com/ruby/reline/pull/460)
* whole_lines should consider prev_line_index, and must not duplicate last_line
* Add test for lines passed to dynamic prompt proc
* Refactor whole_lines parameters used in test helper
* Remove whole_line's arguments
Diffstat (limited to 'test/reline/yamatanooroti/multiline_repl')
-rwxr-xr-x | test/reline/yamatanooroti/multiline_repl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/reline/yamatanooroti/multiline_repl b/test/reline/yamatanooroti/multiline_repl index 7e58b602eb..73f5159ee2 100755 --- a/test/reline/yamatanooroti/multiline_repl +++ b/test/reline/yamatanooroti/multiline_repl @@ -52,6 +52,13 @@ opt.on('--color-bold') { output.gsub(/./) { |c| "\e[1m#{c}\e[0m" } } } +opt.on('--dynamic-prompt-show-line') { + Reline.prompt_proc = proc { |lines| + lines.map { |l| + '[%4.4s]> ' % l + } + } +} opt.on('--auto-indent') { Reline.auto_indent_proc = lambda do |lines, line_index, byte_pointer, is_newline| AutoIndent.calculate_indent(lines, line_index, byte_pointer, is_newline) |