Created
December 20, 2014 23:20
-
-
Save ArtiomL/94c50174142eea1c82dc to your computer and use it in GitHub Desktop.
Sublime Text Plugin - Close Project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sublime Text Plugin - Close Project | |
# (CC0) No Rights Reserved | |
# Artiom Lichtenstein | |
# v1.0, 21/12/2014 | |
# | |
# Key Bindings: { "keys": ["ctrl+shift+0"], "command": "close_project_cmd" } | |
# | |
import sublime, sublime_plugin | |
class CloseProjectCmd(sublime_plugin.WindowCommand): | |
def run(self): | |
bol_MODIFIED = False | |
for tab_CUR in self.window.views(): | |
if tab_CUR.is_dirty(): | |
bol_MODIFIED = True | |
break | |
if bol_MODIFIED: | |
sublime.message_dialog("Please Save Modified Tabs to Close the Project.") | |
else: | |
if int(sublime.version()) >= 3000: | |
self.window.run_command("close_workspace") | |
else: | |
self.window.run_command("close_project") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment