Check wether multibyte character is split
This commit is contained in:
parent
8e53d18e67
commit
0f9ec4a877
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user