def generate_completions(event):
 b = event.current_buffer
 if b.complete_state:
  b.complete_next()
 else:
  event.cli.start_completion(insert_common_part=True, select_first=False)

def generate_completions ( event ) : b = event . current_buffer if b . complete_state : b . complete_next ( ) else : event . cli . start_completion ( insert_common_part = True , select_first = False )
tab-completion: where the first tab completes the common suffix and the second tab lists all the completions .