@@ -753,9 +753,12 @@ def add_normal_character(self, char):
753753 if self .incremental_search_mode :
754754 self .add_to_incremental_search (char )
755755 else :
756- self .current_line = (self .current_line [:self .cursor_offset ] +
757- char +
758- self .current_line [self .cursor_offset :])
756+ self ._set_current_line ((self .current_line [:self .cursor_offset ] +
757+ char +
758+ self .current_line [self .cursor_offset :]),
759+ update_completion = False ,
760+ reset_rl_history = False ,
761+ clear_special_mode = False )
759762 self .cursor_offset += 1
760763 if self .config .cli_trim_prompts and self .current_line .startswith (self .ps1 ):
761764 self .current_line = self .current_line [4 :]
@@ -1232,14 +1235,13 @@ def _get_cursor_offset(self):
12321235 def _set_cursor_offset (self , offset , update_completion = True , reset_rl_history = False , clear_special_mode = True ):
12331236 if self ._cursor_offset == offset :
12341237 return
1235- if update_completion :
1236- self .update_completion ()
12371238 if reset_rl_history :
12381239 self .rl_history .reset ()
12391240 if clear_special_mode :
12401241 self .incremental_search_mode = None
12411242 self ._cursor_offset = offset
1242- self .update_completion ()
1243+ if update_completion :
1244+ self .update_completion ()
12431245 self .unhighlight_paren ()
12441246 cursor_offset = property (_get_cursor_offset , _set_cursor_offset , None ,
12451247 "The current cursor offset from the front of the line" )
0 commit comments