Граф коммитов

304 Коммитов

Автор SHA1 Сообщение Дата
Tim Pope 37d5890e49 [ruby/reline] Fix support for emacs-ctlx and emacs-meta keymaps
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
2022-02-22 18:52:52 +09:00
aycabta 1550756849 [ruby/reline] Use "Bundler.require" to load Gemfile.lock in multiline_repl
https://github.com/ruby/reline/commit/492bee257a
2022-01-16 22:09:32 +09:00
aycabta f5e3913737 [ruby/reline] Fix incremental search to work correctly even if not last line
https://github.com/ruby/reline/commit/21d75f6d4c
2022-01-16 22:09:31 +09:00
aycabta 921ff739df [ruby/reline] Insert newline in the middle of buffer just after dialog
https://github.com/ruby/reline/commit/0c76631132
2022-01-16 22:09:31 +09:00
aycabta d1e078e71c [ruby/reline] Add a wait for a test because sometimes fails
https://github.com/ruby/reline/commit/da4a7aa932
2022-01-16 22:09:30 +09:00
aycabta f94a2adf6a [ruby/reline] Clear dialog when adding new line to end of buffer
https://github.com/ruby/reline/commit/7d38454327
2022-01-16 22:09:28 +09:00
aycabta 9e79ae539b [ruby/reline] Clear dialog when just_move_cursor is called with dialog at last line
https://github.com/ruby/reline/commit/05024b968e
2022-01-11 06:10:37 +09:00
YO4 e3b0c8c106 [ruby/reline] windows: test_yamatanooroti fix
windows can't create too narrow and tall window.

https://github.com/ruby/reline/commit/20b5f2f6fc
2022-01-06 18:33:57 +09:00
aycabta 66e9256147 [ruby/reline] Remove test TODO comments that have been confirmed by E2E tests
https://github.com/ruby/reline/commit/2ed77b693f
2022-01-03 07:06:28 +09:00
aycabta 76181ae940 [ruby/reline] Check capname of tigetstr/tigetflag/tigetnum
Incorrect arguments can cause SEGV.

https://github.com/ruby/reline/commit/a58748bcf9
2022-01-02 11:44:07 +09:00
aycabta f375b6414d [ruby/reline] Add test_tigetstr_with_error
https://github.com/ruby/reline/commit/1ca779740a
2022-01-02 11:44:06 +09:00
aycabta 85f304b931 [ruby/reline] Implement Reline::Terminfo.tigetnum
https://github.com/ruby/reline/commit/695212d5d2
2022-01-02 10:27:09 +09:00
aycabta 0af9eab08e [ruby/reline] Consolidate tests that were unnecessarily divided
https://github.com/ruby/reline/commit/62eec42e4a
2022-01-01 23:13:32 +09:00
aycabta 6300c4dcc3 [ruby/reline] Implement Reline::Terminfo.tigetflag
https://github.com/ruby/reline/commit/0451ed7a28
2022-01-01 23:06:53 +09:00
aycabta 2a311594cc [ruby/reline] Omit a test on Ruby 2.6
Some tokens in Ruby 2.6 have difference information than in 2.7 and later,
but 2.6 will soon be out of support.

https://github.com/ruby/reline/commit/f3bc698385
2021-12-30 20:52:06 +09:00
aycabta 9295732af8 [ruby/reline] Use ripper_lex_without_warning
https://github.com/ruby/reline/commit/b7536dc224
2021-12-30 20:52:06 +09:00
ima1zumi f589242e75 [ruby/reline] Use unix_line_discard when Ctrl-u is entered
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
2021-12-30 20:23:58 +09:00
Hiroshi SHIBATA 239e71c0af [ruby/reline] Use omit instead of skip
https://github.com/ruby/reline/commit/a538de421f
2021-12-29 20:12:36 +09:00
aycabta c815c0be46 [ruby/reline] Escape newline(s) in dynamic prompt
https://github.com/ruby/reline/commit/9b209ee1ea
2021-12-25 00:32:58 +09:00
aycabta b0db420b0e [ruby/reline] Escape newline(s) in prompt
https://github.com/ruby/reline/commit/b545459fca
2021-12-25 00:32:57 +09:00
aycabta bad1e153d4 [ruby/reline] Implement em_kill_line
https://github.com/ruby/reline/commit/9fca6ceb45
2021-12-24 18:23:28 +09:00
aycabta 6c3cc9c58a [ruby/reline] Rename the wrong name "em-kill-line" with the correct name "unix-line-discard"
https://github.com/ruby/reline/commit/da7af35d1f
2021-12-24 18:23:28 +09:00
aycabta 9de42d3b34 [ruby/reline] Bind ed-kill-line to C-u on emacs mode
https://github.com/ruby/reline/commit/9ab99574f5
2021-12-24 18:23:28 +09:00
Yusuke Endoh 424800f707 [ruby/reline] Fix test input_keys to handle "hankaku" characters correctly on Windows
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
2021-12-24 15:01:17 +09:00
aycabta ae770cc372 [ruby/reline] Add encoding info to an assertion of editing line
https://github.com/ruby/reline/commit/22d9262d79
2021-12-24 11:03:34 +09:00
aycabta 547c27e9e7 [ruby/reline] Add a test for halfwidth kana width dakuten
https://github.com/ruby/reline/commit/0895a0d4a1
2021-12-24 00:51:48 +09:00
aycabta 7572e0c6ec [ruby/reline] Add a test for dialog proc with context
https://github.com/ruby/reline/commit/2ce2696d6e
2021-12-20 14:54:45 +09:00
aycabta bb12281164 [ruby/reline] Add an assertion for overwriting dialog proc with the same name
https://github.com/ruby/reline/commit/96067bc13c
2021-12-20 14:54:44 +09:00
aycabta cc072899a1 [ruby/reline] Rename the variable "p" because it overlaps with the "p" method
https://github.com/ruby/reline/commit/9bf2ca692e
2021-12-20 14:54:43 +09:00
aycabta 145c1e0691 [ruby/reline] Add support for overwriting dialog proc with the same name
https://github.com/ruby/reline/commit/16aa20c380
2021-12-20 14:54:42 +09:00
aycabta c462e07a5c [ruby/reline] Add Reline.dialog_proc(name_sym)
https://github.com/ruby/reline/commit/7e5dbe4750
2021-12-20 14:54:42 +09:00
aycabta ec517d60b0 [ruby/reline] Add a test for Reline.add_dialog_proc
https://github.com/ruby/reline/commit/c4bb1bfd79
2021-12-20 14:54:41 +09:00
aycabta 7159af3491 [ruby/reline] Clear dialog in pasting
https://github.com/ruby/reline/commit/dabf5313e0
2021-12-19 11:19:50 +09:00
aycabta adf6c0928d [ruby/reline] Change a test method name to more appropriate
https://github.com/ruby/reline/commit/d014cc85b7
2021-12-18 10:15:23 +09:00
Takashi Kokubun 1a63468831
Prepare for removing RubyVM::JIT (#5262) 2021-12-13 23:07:46 -08:00
aycabta 8411e8449b [ruby/reline] Remove unnecessary variables, lower_space
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
2021-12-13 20:44:21 +09:00
ima1zumi 5f1975a454 [ruby/reline] @convert_meta is true unless 8-bit characters
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
2021-12-10 22:19:14 +09:00
ima1zumi 519a945efc [ruby/reline] Execute compress_meta_key if convert_meta is on
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>
2021-12-10 22:19:14 +09:00
ima1zumi f5829e2935 [ruby/reline] Correct padding space calculation
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
2021-11-21 13:56:26 +09:00
Nobuyoshi Nakada 41db84aa30 [ruby/reline] Skip when unable to set input
`Reline::Windows` always reads from the console by Windows API
 using fiddle.

https://github.com/ruby/reline/commit/c3bf85f5af
2021-10-13 02:24:01 +09:00
Nobuyoshi Nakada 97302a362b [ruby/reline] Close working pipes
https://github.com/ruby/reline/commit/ac519f57ea
2021-10-12 19:11:56 +09:00
Nobuyoshi Nakada 9f94a07e74 [ruby/reline] Fix test class not to overwrite
https://github.com/ruby/reline/commit/1e78984c49
2021-10-11 20:32:34 +09:00
aycabta 990e079b99 [ruby/reline] Reline doesn't have Reline.editing_mode
https://github.com/ruby/reline/commit/90c61d8188
2021-10-11 18:43:27 +09:00
aycabta 5895b4a7d9 [ruby/reline] Add I/O test
https://github.com/ruby/reline/commit/bca9b9012f
2021-10-11 18:43:27 +09:00
aycabta 5987bcaa2d [ruby/reline] Use single quotes to match the others
https://github.com/ruby/reline/commit/58a7ca4101
2021-10-11 18:43:26 +09:00
aycabta b7ac9a2445 [ruby/reline] Add a test for Reline.delete_text
https://github.com/ruby/reline/commit/d1c5700fa3
2021-10-11 18:43:25 +09:00
aycabta 60d20e3537 [ruby/reline] Add assertions for Reline.point
https://github.com/ruby/reline/commit/a8c7b207f0
2021-10-11 18:43:25 +09:00
aycabta 706239fcc1 [ruby/reline] Add a test for Reline.insert_text and Reline.line_buffer
https://github.com/ruby/reline/commit/ae828208e1
2021-10-11 18:43:24 +09:00
aycabta 3112e876a1 [ruby/reline] Add tests for dialog with fullwidth chars and corner cases
https://github.com/ruby/reline/commit/35ab5d47a8
2021-10-11 14:10:35 +09:00
aycabta d0f2c4d053 [ruby/reline] Fix tests to show dialog to the right edge
https://github.com/ruby/reline/commit/6a0d0ada94
2021-10-09 23:23:14 +09:00