##// END OF EJS Templates
Backport PR #12336: Fix auto formatting to be called only once.
Matthias Bussonnier -
Show More
@@ -130,8 +130,10 b' def newline_or_execute_outer(shell):'
130 130 # if all we have after the cursor is whitespace: reformat current text
131 131 # before cursor
132 132 after_cursor = d.text[d.cursor_position:]
133 reformatted = False
133 134 if not after_cursor.strip():
134 135 reformat_text_before_cursor(b, d, shell)
136 reformatted = True
135 137 if not (d.on_last_line or
136 138 d.cursor_position_row >= d.line_count - d.empty_line_count_at_the_end()
137 139 ):
@@ -142,6 +144,7 b' def newline_or_execute_outer(shell):'
142 144 return
143 145
144 146 if (status != 'incomplete') and b.accept_handler:
147 if not reformatted:
145 148 reformat_text_before_cursor(b, d, shell)
146 149 b.validate_and_handle()
147 150 else:
General Comments 0
You need to be logged in to leave comments. Login now