From e9bc8b35c6c860e227627e3b0aab86b4f51c59af Mon Sep 17 00:00:00 2001 From: aycabta Date: Sun, 8 Sep 2019 03:26:09 +0900 Subject: Behave ESC key correctly when vi command mode --- lib/reline/key_actor/vi_command.rb | 2 +- lib/reline/line_editor.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/reline/key_actor/vi_command.rb b/lib/reline/key_actor/vi_command.rb index 5a56fe5694..d3929d6b99 100644 --- a/lib/reline/key_actor/vi_command.rb +++ b/lib/reline/key_actor/vi_command.rb @@ -55,7 +55,7 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base # 26 ^Z :ed_unassigned, # 27 ^[ - :em_meta_next, + :ed_unassigned, # 28 ^\ :ed_ignore, # 29 ^] diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index 597a39107b..2e964cb74a 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -1049,6 +1049,8 @@ class Reline::LineEditor end end + private def ed_unassigned(key) end # do nothing + private def ed_insert(key) if key.instance_of?(String) width = Reline::Unicode.get_mbchar_width(key) -- cgit v1.2.3