code: def edit_and_execute(event):
      
      buff = event.current_buffer
  
      buff.open_in_editor(event.cli)
      buff.accept_action.validate_and_handle(event.cli, buff)
docs: Invoke an editor on the current command line, and accept the result.