Project Manager for Sublime Text 3 . mirror of https://github.com/budRich/ProjectManager
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
612 B

  1. import sublime_plugin
  2. class ProjectManagerCloseWindow(sublime_plugin.WindowCommand):
  3. def run(self):
  4. if self.window.project_file_name():
  5. # if it is a project, close the project
  6. self.window.run_command('close_workspace')
  7. else:
  8. self.window.run_command('close_all')
  9. # exit if there are dirty views
  10. if any([v.is_dirty() for v in self.window.views()]):
  11. return
  12. # close the sidebar
  13. self.window.run_command('close_project')
  14. # close the window
  15. self.window.run_command('close_window')