Skip to content

Commit c7bd67a

Browse files
Merge branch 'fix-308'
Conflicts: bpython/curtsiesfrontend/repl.py
2 parents 67fefb1 + 78e7068 commit c7bd67a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,21 +351,21 @@ def process_event(self, e):
351351
elif e in self.rl_char_sequences:
352352
self.cursor_offset, self.current_line = self.rl_char_sequences[e](self.cursor_offset, self.current_line)
353353
self.update_completion()
354+
self.rl_history.reset()
354355

355356
# readline history commands
356357
elif e in ("<UP>",) + key_dispatch[self.config.up_one_line_key]:
357358
self.rl_history.enter(self.current_line)
358359
self.current_line = self.rl_history.back(False,
359360
search=self.config.curtsies_right_arrow_completion)
360361
self.cursor_offset = len(self.current_line)
361-
self.update_completion()
362362

363363
elif e in ("<DOWN>",) + key_dispatch[self.config.down_one_line_key]:
364364
self.rl_history.enter(self.current_line)
365365
self.current_line = self.rl_history.forward(False,
366366
search=self.config.curtsies_right_arrow_completion)
367367
self.cursor_offset = len(self.current_line)
368-
self.update_completion()
368+
369369
elif e in key_dispatch[self.config.search_key]: #TODO Not Implemented
370370
pass
371371
#TODO add rest of history commands
@@ -402,8 +402,10 @@ def process_event(self, e):
402402
self.update_completion()
403403
elif e == '<TAB>': # tab
404404
self.on_tab()
405+
self.rl_history.reset()
405406
elif e in ("<Shift-TAB>",):
406407
self.on_tab(back=True)
408+
self.rl_history.reset()
407409
elif e in key_dispatch[self.config.undo_key]: #ctrl-r for undo
408410
self.undo()
409411
self.update_completion()
@@ -415,6 +417,7 @@ def process_event(self, e):
415417
g.switch()
416418
elif e in key_dispatch[self.config.external_editor_key]:
417419
self.send_session_to_external_editor()
420+
self.rl_history.reset()
418421
elif e in ["<Ctrl-x>"]:
419422
self.send_current_block_to_external_editor()
420423
elif e in ["<ESC>"]: #ESC
@@ -424,6 +427,7 @@ def process_event(self, e):
424427
self.update_completion()
425428
else:
426429
self.add_normal_character(e)
430+
self.rl_history.reset()
427431
self.update_completion()
428432

429433
def on_enter(self, insert_into_history=True):

0 commit comments

Comments
 (0)