mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/reline] Only show dialogs if default external encoding is UTF-8
Fixes a crash in IRB if a dialog is displayed and the default
external encoding is not UTF-8:
/home/jeremy/tmp/reline/lib/reline/line_editor.rb:731:in `write': U+2588 from UTF-8 to US-ASCII (Encoding::UndefinedConversionError)
f570525ecd
This commit is contained in:
parent
1251edd1db
commit
eb4682b3c6
1 changed files with 1 additions and 0 deletions
|
@ -624,6 +624,7 @@ class Reline::LineEditor
|
|||
|
||||
DIALOG_DEFAULT_HEIGHT = 20
|
||||
private def render_dialog(cursor_column)
|
||||
return unless Encoding.default_external == Encoding::UTF_8
|
||||
@dialogs.each do |dialog|
|
||||
render_each_dialog(dialog, cursor_column)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue