The existing implementation, given the below .inputrc, erroneously
creates a "C-v" key binding:
set keymap emacs-ctlx
"\C-v": "[C-x C-v was pressed]"
This fixes it to instead create a "C-x C-v" keybinding.
https://github.com/ruby/reline/commit/719f52d231
The kill-line was called when C-u was entered, so it is now called unix-line-discard.
In readline(3):
> unix-line-discard (C-u)
> Kill backward from point to the beginning of the line.
> The killed text is saved on the kill-ring.
https://github.com/ruby/reline/commit/27570d195e
The method "input_keys" in test/reline/helper.rb handles a single-byte
and 8-bit charater as an input with the meta key.
However, "test_halfwidth_kana_width_dakuten" in test/reline/test_key_actor_emacs.rb
uses a string that contains "hankaku" characters.
A "hankaku" character is not with the meta key, but it is a single-byte
and 8-bit character on Windows-31J encoding, which confused "input_keys"
method. This caused the following error.
https://ci.appveyor.com/project/ruby/ruby/builds/41997092/job/ejm77qxgvnlpdwvg
```
1) Failure:
Reline::KeyActor::Emacs::Test#test_halfwidth_kana_width_dakuten [C:/projects/ruby/test/reline/test_key_actor_emacs.rb:2311]:
<"\xB6\xDE\xB7\xDE\xB9\xDE\xBA\xDE" (#<Encoding:Windows-31J>)> expected but was
<"\e^\e^\e^\e:\e^" (#<Encoding:Windows-31J>)> in <Terminal #<Encoding:Windows-31J>>
.
<8> expected but was
<10>.
Finished tests in 1045.472722s, 19.3922 tests/s, 2609.4320 assertions/s.
```
This change introduces "input_raw_keys" that does not convert a
single-byte and 8-bit character to "with the meta key", and use it in
the test in question.
https://github.com/ruby/reline/commit/f6ae0e5d19
The number of lines below the cursor position was known by
"@rest_height" alone, but the problem was caused by adding
"lower_space". Remove "lower_space" as it is unnecessary.
https://github.com/ruby/reline/commit/a575cef6a3
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