| 940 | self.cut_buffer = cut |
| 941 | |
| 942 | def on_enter(self, new_code=True, reset_rl_history=True): |
| 943 | # so the cursor isn't touching a paren TODO: necessary? |
| 944 | if new_code: |
| 945 | self.redo_stack = [] |
| 946 | |
| 947 | self._set_cursor_offset(-1, update_completion=False) |
| 948 | if reset_rl_history: |
| 949 | self.rl_history.reset() |
| 950 | |
| 951 | self.history.append(self.current_line) |
| 952 | self.all_logical_lines.append((self.current_line, LineType.INPUT)) |
| 953 | self.push(self.current_line, insert_into_history=new_code) |
| 954 | |
| 955 | def on_tab(self, back=False): |
| 956 | """Do something on tab key |