If Reline::IOGate.encoding contains 7-bit characters, convert-meta will set it On.
Because in readline(3):
> The default is On, but readline will set it to Off if the locale contains eight-bit characters.
As far as I know, 7-bit encoding used in terminals is only US-ASCII.
https://github.com/ruby/reline/commit/b71d1fa496
fix `#357`
When using 8-bit characters, it is better not to use `compress_meta_key`.
I believe not to use `compress_meta_key` unless `set convert-meta on` is written in the `.inputrc`.
The following is a quote from tmtm's comments.
> The behavior of this compress_meta_key method is similar to the behavior of convert-meta=on in readline, but readline turns off convert-meta if the locale contains 8bit characters.
> In readline(3):
> convert-meta (On)
> If set to On, readline will convert characters with the eighth
> bit set to an ASCII key sequence by stripping the eighth bit and
> prefixing it with an escape character (in effect, using escape
> as the meta prefix). The default is On, but readline will set
> it to Off if the locale contains eight-bit characters.
https://github.com/ruby/reline/commit/9491cc8542
Co-authored-by: TOMITA Masahiro <tommy@tmtm.org>
fix https://github.com/ruby/irb/issues/308
This bug occurred when `dialog.width - calculate_width(s, true)` was negative.
When `dialog.width` is shorter than `old_dialog.width`, it calculates how much padding it has to do. However, there are cases where `s` is longer than `dialog.width`, as in the issue. In that case, `padding_space_with_escape_sequences` will crash.
Here, `old_dialog.width` is longer than `dialog.width`, so I changed the padding width to `old_dialog.width - dialog.width`.
https://github.com/ruby/reline/commit/c581c31e0f
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)
https://github.com/ruby/reline/commit/f570525ecd
The vi mode can handle "argument number" before an operator or a motion,
such as, "3x" (equals "xxx"), and "3l" (equals "lll"). In the emacs
mode, GNU Readline can handle argument number with meta key, like
"Meta+3 x" (equals "xxx").
https://github.com/ruby/reline/commit/9183cc2e8b
This operation is mentioned and bound to `^U` in both `vi_command.rb`
and `vi_insert.rb`, but there is no definition of it.
Both Vi and Emacs use the same keystroke to do the same behavior, so
I've chosen to use `alias_method` to make the implementation small,
rather than duplicating the method and re-implementing it.
https://github.com/ruby/reline/commit/fdbfc8669f
@jhawthorn said, "this will make Ruby's integer comparisons slower
globally." It looks like "binding.irb" is going to cause serious
problems in Rails applications.
https://github.com/ruby/reline/commit/ee8d6c6a82