mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 22:14:37 +02:00
[ruby/reline] Fix prompt width calculation bug. Test with colored
prompt
(https://github.com/ruby/reline/pull/695)
24aab01cbc
This commit is contained in:
parent
ed5a7a59c0
commit
eb82ea6218
2 changed files with 3 additions and 3 deletions
|
@ -387,7 +387,7 @@ class Reline::LineEditor
|
|||
next cached
|
||||
end
|
||||
*wrapped_prompts, code_line_prompt = split_by_width(prompt, width).first.compact
|
||||
wrapped_lines = split_by_width(line, width, offset: calculate_width(code_line_prompt)).first.compact
|
||||
wrapped_lines = split_by_width(line, width, offset: calculate_width(code_line_prompt, true)).first.compact
|
||||
wrapped_prompts.map { |p| [p, ''] } + [[code_line_prompt, wrapped_lines.first]] + wrapped_lines.drop(1).map { |c| ['', c] }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue