[ruby/reline] Separate keystrokes each editing mode

ee23e6f3f8
This commit is contained in:
aycabta 2021-04-05 16:03:53 +09:00 committed by Nobuyoshi Nakada
parent 16f31da92e
commit 5543695a19
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
7 changed files with 128 additions and 69 deletions

View file

@ -241,6 +241,21 @@ class Reline::Config::Test < Reline::TestCase
assert_equal expected, @config.key_bindings
end
def test_additional_key_bindings_for_other_keymap
@config.read_lines(<<~'LINES'.lines)
set keymap vi-command
"ab": "AB"
set keymap vi-insert
"cd": "CD"
set keymap emacs
"ef": "EF"
set editing-mode vi # keymap changes to be vi-insert
LINES
expected = { 'cd'.bytes => 'CD'.bytes }
assert_equal expected, @config.key_bindings
end
def test_history_size
@config.read_lines(<<~LINES.lines)
set history-size 5000