File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -684,10 +684,16 @@ def readline_kill(self, e):
684
684
685
685
def on_enter (self , insert_into_history = True ):
686
686
# so the cursor isn't touching a paren TODO: necessary?
687
- self ._set_cursor_offset (- 1 , update_completion = False )
688
687
689
- self .history .append (self .current_line )
690
- self .push (self .current_line , insert_into_history = insert_into_history )
688
+ try :
689
+ self .interp .compile ('\n ' .join (self .buffer + [self .current_line ]))
690
+ except (ValueError , SyntaxError , OverflowError ) as e :
691
+ self .status_bar .message (str (e ))
692
+ else :
693
+ self ._set_cursor_offset (- 1 , update_completion = False )
694
+
695
+ self .history .append (self .current_line )
696
+ self .push (self .current_line , insert_into_history = insert_into_history )
691
697
692
698
def on_tab (self , back = False ):
693
699
"""Do something on tab key
You can’t perform that action at this time.
0 commit comments