summaryrefslogtreecommitdiff
path: root/lib/reline/key_stroke.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-05-13 02:26:31 +0900
committeraycabta <aycabta@gmail.com>2019-05-13 02:26:31 +0900
commit5837290af1216eaadbee3204e40ef16931da2fdb (patch)
tree6f3a5886d5b0755415aa09df0d8cfaa9516eeb1b /lib/reline/key_stroke.rb
parentc137f015ab2283e885168f983e36e4bd2c1aa29e (diff)
Implement Reline's class methods for compatibility
- insert_text - redisplay - line_buffer - point - point= - vi_editing_mode - emacs_editing_mode - vi_editing_mode? - emacs_editing_mode? - get_screen_size
Diffstat (limited to 'lib/reline/key_stroke.rb')
-rw-r--r--lib/reline/key_stroke.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/reline/key_stroke.rb b/lib/reline/key_stroke.rb
index ac0a820759..fdfe74a6ee 100644
--- a/lib/reline/key_stroke.rb
+++ b/lib/reline/key_stroke.rb
@@ -28,6 +28,9 @@ class Reline::KeyStroke
end
def input_to!(bytes)
+ if bytes.nil?
+ return @buffer.push(nil)&.tap { clear }
+ end
@buffer.concat Array(bytes)
input_to(@buffer)&.tap { clear }
end