##// END OF EJS Templates
Merge remote-tracking branch 'origin/master' into inputtransformer2
Matthias Bussonnier -
r24502:0f127776 merge
parent child Browse files
Show More
@@ -0,0 +1,2 b''
1 The autoindent feature that was deprecated in 5.x was re-enabled and
2 un-deprecated in :ghpull:`11257`
@@ -250,8 +250,7 b' class InteractiveShell(SingletonConfigurable):'
250 250 objects are automatically called (even if no arguments are present).
251 251 """
252 252 ).tag(config=True)
253 # TODO: remove all autoindent logic and put into frontends.
254 # We can't do this yet because even runlines uses the autoindent.
253
255 254 autoindent = Bool(True, help=
256 255 """
257 256 Autoindent IPython code entered interactively.
@@ -80,8 +80,6 b' class TerminalMagics(Magics):'
80 80 @line_magic
81 81 def autoindent(self, parameter_s = ''):
82 82 """Toggle autoindent on/off (deprecated)"""
83 print("%autoindent is deprecated since IPython 5: you can now paste "
84 "multiple lines without turning autoindentation off.")
85 83 self.shell.set_autoindent()
86 84 print("Automatic indentation is:",['OFF','ON'][self.shell.autoindent])
87 85
@@ -111,13 +111,19 b' def newline_or_execute_outer(shell):'
111 111 if not (d.on_last_line or
112 112 d.cursor_position_row >= d.line_count - d.empty_line_count_at_the_end()
113 113 ):
114 b.insert_text('\n' + indent)
114 if shell.autoindent:
115 b.insert_text('\n' + indent)
116 else:
117 b.insert_text('\n')
115 118 return
116 119
117 120 if (status != 'incomplete') and b.accept_handler:
118 121 b.validate_and_handle()
119 122 else:
120 b.insert_text('\n' + indent)
123 if shell.autoindent:
124 b.insert_text('\n' + indent)
125 else:
126 b.insert_text('\n')
121 127 return newline_or_execute
122 128
123 129
@@ -67,7 +67,6 b' Example config file'
67 67 'mycode.py',
68 68 'fancy.ipy'
69 69 ]
70 c.InteractiveShell.autoindent = True
71 70 c.InteractiveShell.colors = 'LightBG'
72 71 c.InteractiveShell.confirm_exit = False
73 72 c.InteractiveShell.editor = 'nano'
@@ -146,7 +146,7 b' The built-in magics include:'
146 146 :magic:`macro`, :magic:`recall`, etc.
147 147
148 148 - Functions which affect the shell: :magic:`colors`, :magic:`xmode`,
149 :magic:`autoindent`, :magic:`automagic`, etc.
149 :magic:`automagic`, etc.
150 150
151 151 - Other functions such as :magic:`reset`, :magic:`timeit`,
152 152 :cellmagic:`writefile`, :magic:`load`, or :magic:`paste`.
General Comments 0
You need to be logged in to leave comments. Login now