[ruby/reline] Suppress error when check ambiguous char width in LANG=C
https://github.com/ruby/reline/commit/623dffdd75
This commit is contained in:
parent
8911b3d3e8
commit
69cd27c98e
@ -336,8 +336,14 @@ module Reline
|
|||||||
@ambiguous_width = 2 if Reline::IOGate == Reline::GeneralIO or STDOUT.is_a?(File)
|
@ambiguous_width = 2 if Reline::IOGate == Reline::GeneralIO or STDOUT.is_a?(File)
|
||||||
return if ambiguous_width
|
return if ambiguous_width
|
||||||
Reline::IOGate.move_cursor_column(0)
|
Reline::IOGate.move_cursor_column(0)
|
||||||
output.write "\u{25bd}"
|
begin
|
||||||
@ambiguous_width = Reline::IOGate.cursor_pos.x
|
output.write "\u{25bd}"
|
||||||
|
rescue Encoding::UndefinedConversionError
|
||||||
|
# LANG=C
|
||||||
|
@ambiguous_width = 1
|
||||||
|
else
|
||||||
|
@ambiguous_width = Reline::IOGate.cursor_pos.x
|
||||||
|
end
|
||||||
Reline::IOGate.move_cursor_column(0)
|
Reline::IOGate.move_cursor_column(0)
|
||||||
Reline::IOGate.erase_after_cursor
|
Reline::IOGate.erase_after_cursor
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user