@@ -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