##// END OF EJS Templates
Only strip whitespace from cell once when filling readline history.
Thomas Kluyver -
Show More
@@ -1798,15 +1798,16 b' class InteractiveShell(SingletonConfigurable, Magic):'
1798 for _, _, cell in self.history_manager.get_tail(1000,
1798 for _, _, cell in self.history_manager.get_tail(1000,
1799 include_latest=True):
1799 include_latest=True):
1800 # Ignore blank lines and consecutive duplicates
1800 # Ignore blank lines and consecutive duplicates
1801 if cell.strip() and cell.rstrip()!=last_cell:
1801 cell = cell.rstrip()
1802 if cell and (cell != last_cell):
1802 if self.multiline_history:
1803 if self.multiline_history:
1803 self.readline.add_history(py3compat.unicode_to_str(cell.rstrip(),
1804 self.readline.add_history(py3compat.unicode_to_str(cell,
1804 stdin_encoding))
1805 stdin_encoding))
1805 else:
1806 else:
1806 for line in cell.splitlines():
1807 for line in cell.splitlines():
1807 self.readline.add_history(py3compat.unicode_to_str(line,
1808 self.readline.add_history(py3compat.unicode_to_str(line,
1808 stdin_encoding))
1809 stdin_encoding))
1809 last_cell = cell.rstrip()
1810 last_cell = cell
1810
1811
1811 def set_next_input(self, s):
1812 def set_next_input(self, s):
1812 """ Sets the 'default' input string for the next command line.
1813 """ Sets the 'default' input string for the next command line.
General Comments 0
You need to be logged in to leave comments. Login now