Created
January 9, 2023 09:44
-
-
Save kostyay/84ab4d1962481d443a6718210be5c448 to your computer and use it in GitHub Desktop.
Sublime 3 Close All Windows without saving
This file contains 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
# This will close all views (files open in specific window) without asking to save them | |
# You can register it to a keyboard shorcut using this snippet | |
# {"keys": ["ctrl+shift+q"], "command": "close_without_saving"} | |
import sublime | |
import sublime_plugin | |
class CloseWithoutSaving(sublime_plugin.WindowCommand): | |
def run(self): | |
window = self.window | |
for v in window.views(): | |
print ("Closing %s" % v.file_name ()) | |
v.set_scratch(True) | |
v.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment