File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -336,6 +336,12 @@ def process_event(self, e):
336336 self .update_completion ()
337337 return
338338
339+ elif e in ("KEY_RIGHT" ) and self .cursor_offset == len (self .current_line ):
340+
341+ self .current_line += self .current_suggestion
342+ self .cursor_offset = len (self .current_line )
343+ self .update_completion ()
344+
339345 elif e in self .rl_char_sequences :
340346 self .cursor_offset , self .current_line = self .rl_char_sequences [e ](self .cursor_offset , self .current_line )
341347 self .update_completion ()
@@ -705,8 +711,8 @@ def current_cursor_line(self):
705711
706712 @property
707713 def current_suggestion (self ):
708- matches = [e for e in self .rl_history .entries if e .startswith (self .current_line )]
709- return matches [0 ][len (self .current_line ):] if matches else ''
714+ matches = [e for e in self .rl_history .entries if e .startswith (self .current_line ) and self . current_line ]
715+ return matches [- 1 ][len (self .current_line ):] if matches else ''
710716
711717 @property
712718 def current_output_line (self ):
You can’t perform that action at this time.
0 commit comments