X Tutup
Skip to content

Commit 71955bd

Browse files
prevent hide paren from accessing nonexistant lines
1 parent 648d0b2 commit 71955bd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,14 +673,16 @@ def yank_from_buffer(self):
673673
def up_one_line(self):
674674
self.rl_history.enter(self.current_line)
675675
self._set_current_line(tabs_to_spaces(self.rl_history.back(False,
676-
search=self.config.curtsies_right_arrow_completion)),
676+
search=self.config.curtsies_right_arrow_completion)),
677+
update_completion=False,
677678
reset_rl_history=False)
678679
self._set_cursor_offset(len(self.current_line), reset_rl_history=False)
679680

680681
def down_one_line(self):
681682
self.rl_history.enter(self.current_line)
682683
self._set_current_line(tabs_to_spaces(self.rl_history.forward(False,
683-
search=self.config.curtsies_right_arrow_completion)),
684+
search=self.config.curtsies_right_arrow_completion)),
685+
update_completion=False,
684686
reset_rl_history=False)
685687
self._set_cursor_offset(len(self.current_line), reset_rl_history=False)
686688

@@ -838,10 +840,10 @@ def push(self, line, insert_into_history=True):
838840
self.saved_predicted_parse_error = not code_will_parse
839841
if c:
840842
logger.debug('finished - buffer cleared')
843+
self.cursor_offset = 0
841844
self.display_lines.extend(self.display_buffer_lines)
842845
self.display_buffer = []
843846
self.buffer = []
844-
self.cursor_offset = 0
845847

846848
self.coderunner.load_code(code_to_run)
847849
self.run_code_and_maybe_finish()

0 commit comments

Comments
 (0)
X Tutup