##// END OF EJS Templates
Prefer execution when there's only a single line entered...
Thomas Kluyver -
Show More
@@ -108,8 +108,13 b' def newline_or_execute_outer(shell):'
108 b.cancel_completion()
108 b.cancel_completion()
109 return
109 return
110
110
111 before_text = d.text[:d.cursor_position]
111 # If there's only one line, treat it as if the cursor is at the end.
112 status, indent = shell.input_splitter.check_complete(before_text + '\n')
112 # See https://github.com/ipython/ipython/issues/10425
113 if d.line_count == 1:
114 check_text = d.text
115 else:
116 check_text = d.text[:d.cursor_position]
117 status, indent = shell.input_splitter.check_complete(check_text + '\n')
113
118
114 if not (d.on_last_line or
119 if not (d.on_last_line or
115 d.cursor_position_row >= d.line_count - d.empty_line_count_at_the_end()
120 d.cursor_position_row >= d.line_count - d.empty_line_count_at_the_end()
General Comments 0
You need to be logged in to leave comments. Login now