# File lib/rbreadline.rb, line 6409
  def insert_match(match, start, mtype, qc)
    oqc = qc
    replacement = make_quoted_replacement(match, mtype, qc)

    # Now insert the match.
    if (replacement)
      # Don't double an opening quote character.
      if (qc && qc.length>0 && start!=0 && @rl_line_buffer[start - 1,1] == qc &&
          replacement[0,1] == qc)
        start-=1
        # If make_quoted_replacement changed the quoting character, remove
        # the opening quote and insert the (fully-quoted) replacement.
      elsif (qc && (qc != oqc) && start!=0 && @rl_line_buffer[start - 1,1] == oqc &&
             replacement[0,1] != oqc)
        start-=1
      end
      _rl_replace_text(replacement, start, @rl_point - 1)
      if (replacement != match)
        replacement = nil
      end
    end
  end