Created
June 10, 2019 07:38
-
-
Save nulldef/2c3bf48fb16a0736fe211ce7be8d5af2 to your computer and use it in GitHub Desktop.
Delete opened files sublime plugin
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
import sublime | |
import sublime_plugin | |
import os | |
class DeleteOpenedFileCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
file_path = self.view.file_name() | |
ok = sublime.ok_cancel_dialog("Really remove?", "Yeah, baby!") | |
if ok: | |
self.view.close() | |
os.remove(file_path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment