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 | objects are automatically called (even if no arguments are present). |
|
250 | objects are automatically called (even if no arguments are present). | |
251 | """ |
|
251 | """ | |
252 | ).tag(config=True) |
|
252 | ).tag(config=True) | |
253 | # TODO: remove all autoindent logic and put into frontends. |
|
253 | ||
254 | # We can't do this yet because even runlines uses the autoindent. |
|
|||
255 | autoindent = Bool(True, help= |
|
254 | autoindent = Bool(True, help= | |
256 | """ |
|
255 | """ | |
257 | Autoindent IPython code entered interactively. |
|
256 | Autoindent IPython code entered interactively. |
@@ -80,8 +80,6 b' class TerminalMagics(Magics):' | |||||
80 | @line_magic |
|
80 | @line_magic | |
81 | def autoindent(self, parameter_s = ''): |
|
81 | def autoindent(self, parameter_s = ''): | |
82 | """Toggle autoindent on/off (deprecated)""" |
|
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 | self.shell.set_autoindent() |
|
83 | self.shell.set_autoindent() | |
86 | print("Automatic indentation is:",['OFF','ON'][self.shell.autoindent]) |
|
84 | print("Automatic indentation is:",['OFF','ON'][self.shell.autoindent]) | |
87 |
|
85 |
@@ -111,13 +111,19 b' def newline_or_execute_outer(shell):' | |||||
111 | if not (d.on_last_line or |
|
111 | if not (d.on_last_line or | |
112 | d.cursor_position_row >= d.line_count - d.empty_line_count_at_the_end() |
|
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 | return |
|
118 | return | |
116 |
|
119 | |||
117 | if (status != 'incomplete') and b.accept_handler: |
|
120 | if (status != 'incomplete') and b.accept_handler: | |
118 | b.validate_and_handle() |
|
121 | b.validate_and_handle() | |
119 | else: |
|
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 | return newline_or_execute |
|
127 | return newline_or_execute | |
122 |
|
128 | |||
123 |
|
129 |
@@ -67,7 +67,6 b' Example config file' | |||||
67 | 'mycode.py', |
|
67 | 'mycode.py', | |
68 | 'fancy.ipy' |
|
68 | 'fancy.ipy' | |
69 | ] |
|
69 | ] | |
70 | c.InteractiveShell.autoindent = True |
|
|||
71 | c.InteractiveShell.colors = 'LightBG' |
|
70 | c.InteractiveShell.colors = 'LightBG' | |
72 | c.InteractiveShell.confirm_exit = False |
|
71 | c.InteractiveShell.confirm_exit = False | |
73 | c.InteractiveShell.editor = 'nano' |
|
72 | c.InteractiveShell.editor = 'nano' |
@@ -146,7 +146,7 b' The built-in magics include:' | |||||
146 | :magic:`macro`, :magic:`recall`, etc. |
|
146 | :magic:`macro`, :magic:`recall`, etc. | |
147 |
|
147 | |||
148 | - Functions which affect the shell: :magic:`colors`, :magic:`xmode`, |
|
148 | - Functions which affect the shell: :magic:`colors`, :magic:`xmode`, | |
149 |
|
|
149 | :magic:`automagic`, etc. | |
150 |
|
150 | |||
151 | - Other functions such as :magic:`reset`, :magic:`timeit`, |
|
151 | - Other functions such as :magic:`reset`, :magic:`timeit`, | |
152 | :cellmagic:`writefile`, :magic:`load`, or :magic:`paste`. |
|
152 | :cellmagic:`writefile`, :magic:`load`, or :magic:`paste`. |
General Comments 0
You need to be logged in to leave comments.
Login now