code: def generate_completions(event):
      r
      b = event.current_buffer
  
      # When already navigating through completions, select the next one.
      if b.complete_state:
          b.complete_next()
      else:
          event.cli.start_completion(insert_common_part=True, select_first=False)
docs: r"""
      Tab-completion: where the first tab completes the common suffix and the
      second tab lists all the completions.