From 094340ac7c58890e00ae72b5dbdfdef6abcb0c2b 2013-07-17 17:28:05 From: MinRK Date: 2013-07-17 17:28:05 Subject: [PATCH] push cell magic to the head of the transformer line I'm not 100% sure this is the right fix (ping @takluyver for review), since it is unclear what the physical/logical distinction is, but this does allow the cell magic transform to preempt all other transforms. closes #3604 --- diff --git a/IPython/core/inputsplitter.py b/IPython/core/inputsplitter.py index 6028266..5eef18a 100644 --- a/IPython/core/inputsplitter.py +++ b/IPython/core/inputsplitter.py @@ -486,7 +486,9 @@ class IPythonInputSplitter(InputSplitter): if physical_line_transforms is not None: self.physical_line_transforms = physical_line_transforms else: - self.physical_line_transforms = [leading_indent(), + self.physical_line_transforms = [ + cellmagic(end_on_blank_line=line_input_checker), + leading_indent(), classic_prompt(), ipy_prompt(), strip_encoding_cookie(), @@ -496,7 +498,7 @@ class IPythonInputSplitter(InputSplitter): if logical_line_transforms is not None: self.logical_line_transforms = logical_line_transforms else: - self.logical_line_transforms = [cellmagic(end_on_blank_line=line_input_checker), + self.logical_line_transforms = [ help_end(), escaped_commands(), assign_from_magic(),