def _replace_rlhist_multiline(self, source_raw, hlen_before_cell):
<EOL>if not self.has_readline or not self.multiline_history:<EOL><INDENT>return hlen_before_cell<EOL><DEDENT>if not hasattr(self.readline, "<STR_LIT>"):<EOL><INDENT>return hlen_before_cell<EOL><DEDENT>if not source_raw.rstrip():<EOL><INDENT>return hlen_before_cell<EOL><DEDENT>hlen = self.readline.get_current_history_length()<EOL>if hlen == hlen_before_cell:<EOL><INDENT>return hlen_before_cell<EOL><DEDENT>for i in range(hlen - hlen_before_cell):<EOL><INDENT>self.readline.remove_history_item(hlen - i - <NUM_LIT:1>)<EOL><DEDENT>stdin_encoding = get_stream_enc(sys.stdin, '<STR_LIT:utf-8>')<EOL>self.readline.add_history(py3compat.unicode_to_str(source_raw.rstrip(),<EOL>stdin_encoding))<EOL>return self.readline.get_current_history_length()<EOL>
Store multiple lines as a single entry in history