mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Use negative lookahead and start_with?
This commit is contained in:
parent
fcca39fa73
commit
ecd0f1d966
1 changed files with 1 additions and 1 deletions
|
@ -763,7 +763,7 @@ class Reline::LineEditor
|
|||
i = 0
|
||||
while i < @byte_pointer do
|
||||
slice = @line.byteslice(i, @byte_pointer - i)
|
||||
if quote and slice =~ /\A(?<!\\)#{Regexp.escape(quote)}/ # closing "
|
||||
if quote and slice.start_with?(/(?!\\)#{Regexp.escape(quote)}/) # closing "
|
||||
quote = nil
|
||||
i += 1
|
||||
elsif quote and slice =~ /\A\\#{Regexp.escape(quote)}/ # escaped \"
|
||||
|
|
Loading…
Add table
Reference in a new issue