##// END OF EJS Templates
Make cell magic input only allow one blank line for consistency.
Fernando Perez -
Show More
@@ -852,7 +852,7 b' class IPythonInputSplitter(InputSplitter):'
852
852
853 This means that we get the entire cell with each call. Between resets,
853 This means that we get the entire cell with each call. Between resets,
854 the calls simply add more text to the input."""
854 the calls simply add more text to the input."""
855 print('lines', repr(lines)) # dbg
855 #print('lines', repr(lines)) # dbg
856 if lines.startswith('%%'):
856 if lines.startswith('%%'):
857 # Cell magics bypass all further transformations
857 # Cell magics bypass all further transformations
858 self.cell_magic_mode = True
858 self.cell_magic_mode = True
@@ -868,8 +868,14 b' class IPythonInputSplitter(InputSplitter):'
868 tlines = tpl % (magic_name, line)
868 tlines = tpl % (magic_name, line)
869 self._store(tlines)
869 self._store(tlines)
870 self._store(lines, self._buffer_raw, 'source_raw')
870 self._store(lines, self._buffer_raw, 'source_raw')
871 self._is_complete = last_two_blanks(lines)
871 # We can actually choose whether to allow for single blank lines
872 print('IC', self._is_complete) # dbg
872 # here.. My first implementation did that, and then I realized it
873 # wasn't consistent with the console behavior, so I've reverted it
874 # to one line. But I'm leaving it here so we can easily test both
875 # behaviors, I kind of liked having the extra blanks be allowed in
876 # the cell magics...
877 #self._is_complete = last_two_blanks(lines)
878 self._is_complete = last_blank(lines)
873 return self._is_complete
879 return self._is_complete
874
880
875 lines_list = lines.splitlines()
881 lines_list = lines.splitlines()
General Comments 0
You need to be logged in to leave comments. Login now