code: def quit(editor, all_=False, force=False):
      
      ebs = editor.window_arrangement.editor_buffers
  
      # When there are buffers that have unsaved changes, show balloon.
      if not force and any(eb.has_unsaved_changes for eb in ebs):
          editor.show_message(_NO_WRITE_SINCE_LAST_CHANGE_TEXT)
  
      # When there is more than one buffer open.
      elif not all_ and len(ebs) > 1:
          editor.show_message('%i more files to edit' % (len(ebs) - 1))
  
      else:
          editor.application.exit()
docs: Quit.