diff options
author | Phillip Hellewell <sshock@users.noreply.github.com> | 2023-03-21 08:48:25 -0600 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-03-21 14:48:32 +0000 |
commit | f67f0d72688679267c4040c5f6aa8c493067704a (patch) | |
tree | 60214c61ab2b7846f54daff338e395fdb64db91a /test/reline | |
parent | 9b85ff01a15a559775cb1df5e32401c9fcc37682 (diff) | |
download | ruby-f67f0d72688679267c4040c5f6aa8c493067704a.tar.gz |
[ruby/reline] Add key bindings for PgUp and PgDn
(https://github.com/ruby/reline/pull/509)
* Add key bindings for PgUp, PgDn
* Match behavior of readline 8.2
In the latest readline (8.2), page-up and page-down are bound to
history-search-backward and history-search-forward by default.
We would like reline to have the same default behavior.
Diffstat (limited to 'test/reline')
-rw-r--r-- | test/reline/test_ansi_with_terminfo.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/reline/test_ansi_with_terminfo.rb b/test/reline/test_ansi_with_terminfo.rb index a6c3a5e500..d7f61806a6 100644 --- a/test/reline/test_ansi_with_terminfo.rb +++ b/test/reline/test_ansi_with_terminfo.rb @@ -33,6 +33,20 @@ class Reline::ANSI::TestWithTerminfo < Reline::TestCase omit e.message end + # PgUp key + def test_kpp + assert_key_binding(Reline::Terminfo.tigetstr('kpp'), :ed_search_prev_history) + rescue Reline::Terminfo::TerminfoError => e + omit e.message + end + + # PgDn key + def test_knp + assert_key_binding(Reline::Terminfo.tigetstr('knp'), :ed_search_next_history) + rescue Reline::Terminfo::TerminfoError => e + omit e.message + end + # Up arrow key def test_kcuu1 assert_key_binding(Reline::Terminfo.tigetstr('kcuu1'), :ed_prev_history) |