@@ -927,7 +927,7 @@ def current_line_formatted(self):
927927 if self .incremental_search_target in self .current_line :
928928 fs = fmtfuncs .on_magenta (self .incremental_search_target ).join (fs .split (self .incremental_search_target ))
929929 elif self .rl_history .saved_line and self .rl_history .saved_line in self .current_line :
930- if self .config .curtsies_right_arrow_completion :
930+ if self .config .curtsies_right_arrow_completion and self . rl_history . index != 0 :
931931 fs = fmtfuncs .on_magenta (self .rl_history .saved_line ).join (fs .split (self .rl_history .saved_line ))
932932 logger .debug ('Display line %r -> %r' , self .current_line , fs )
933933 else :
@@ -1203,6 +1203,8 @@ def __repr__(self):
12031203 def _get_current_line (self ):
12041204 return self ._current_line
12051205 def _set_current_line (self , line , update_completion = True , reset_rl_history = True , clear_special_mode = True ):
1206+ if self ._current_line == line :
1207+ return
12061208 self ._current_line = line
12071209 if update_completion :
12081210 self .update_completion ()
@@ -1214,7 +1216,7 @@ def _set_current_line(self, line, update_completion=True, reset_rl_history=True,
12141216 "The current line" )
12151217 def _get_cursor_offset (self ):
12161218 return self ._cursor_offset
1217- def _set_cursor_offset (self , offset , update_completion = True , reset_rl_history = True , clear_special_mode = True ):
1219+ def _set_cursor_offset (self , offset , update_completion = True , reset_rl_history = False , clear_special_mode = True ):
12181220 if update_completion :
12191221 self .update_completion ()
12201222 if reset_rl_history :
0 commit comments