Check wether multibyte character is split

This commit is contained in:
aycabta 2019-07-25 17:19:11 +09:00
parent 8e53d18e67
commit 0f9ec4a877

View File

@ -811,6 +811,10 @@ class Reline::LineEditor
i = 0 i = 0
while i < @byte_pointer do while i < @byte_pointer do
slice = @line.byteslice(i, @byte_pointer - i) 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 " if quote and slice.start_with?(/(?!\\)#{Regexp.escape(quote)}/) # closing "
quote = nil quote = nil
i += 1 i += 1