##// END OF EJS Templates
Fix paste/cpaste magic
Takumasa Nakamura -
Show More
@@ -3138,8 +3138,12 b' class InteractiveShell(SingletonConfigurable):'
3138 else:
3138 else:
3139 cell = raw_cell
3139 cell = raw_cell
3140
3140
3141 # Do NOT store paste/cpaste magic history
3142 if "get_ipython().run_line_magic(" in cell and "paste" in cell:
3143 store_history = False
3144
3141 # Store raw and processed history
3145 # Store raw and processed history
3142 if store_history and raw_cell.strip(" %") != "paste":
3146 if store_history:
3143 self.history_manager.store_inputs(self.execution_count, cell, raw_cell)
3147 self.history_manager.store_inputs(self.execution_count, cell, raw_cell)
3144 if not silent:
3148 if not silent:
3145 self.logger.log(cell, raw_cell)
3149 self.logger.log(cell, raw_cell)
@@ -147,7 +147,7 b' class TerminalMagics(Magics):'
147
147
148 sentinel = opts.get('s', u'--')
148 sentinel = opts.get('s', u'--')
149 block = '\n'.join(get_pasted_lines(sentinel, quiet=quiet))
149 block = '\n'.join(get_pasted_lines(sentinel, quiet=quiet))
150 self.store_or_execute(block, name, store_history=False)
150 self.store_or_execute(block, name, store_history=True)
151
151
152 @line_magic
152 @line_magic
153 def paste(self, parameter_s=''):
153 def paste(self, parameter_s=''):
General Comments 0
You need to be logged in to leave comments. Login now