aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/reline/line_editor.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index a238e4954c..e9e693eb2b 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -811,6 +811,10 @@ class Reline::LineEditor
i = 0
while i < @byte_pointer do
slice = @line.byteslice(i, @byte_pointer - i)
+ unless slice.valid_encoding?
+ i += 1
+ next
+ end
if quote and slice.start_with?(/(?!\\)#{Regexp.escape(quote)}/) # closing "
quote = nil
i += 1