Commit edb76c88 authored by Javier Hernández's avatar Javier Hernández

ipython: Adding auto-indentation

parent b28c85cc
......@@ -171,9 +171,11 @@ class IterableIPShell:
if not self.iter_more:
source_raw = self.IP.input_splitter.raw_reset()
self.IP.run_cell(source_raw, store_history=True)
self.IP.rl_do_indent = False
else:
# TODO: Auto-indent
#
self.IP.rl_do_indent = True
pass
sys.stdout = orig_stdout
......@@ -462,6 +464,10 @@ class ConsoleView(gtk.TextView):
self.text_buffer.move_mark(self.line_start, self.text_buffer.get_end_iter())
self.text_buffer.place_cursor(self.text_buffer.get_end_iter())
if self.IP.rl_do_indent:
indentation = self.IP.input_splitter.indent_spaces * ' '
self.text_buffer.insert_at_cursor(indentation)
def onKeyPress(self, widget, event):
'''
Key press callback used for correcting behavior for console-like
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment