Skip to content

Commit

Permalink
Use negative lookahead and start_with?
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed May 30, 2019
1 parent fcca39f commit ecd0f1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/reline/line_editor.rb
Expand Up @@ -763,7 +763,7 @@ def retrieve_completion_block
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 \"
Expand Down

0 comments on commit ecd0f1d

Please sign in to comment.