Skip to content

Commit

Permalink
first created
Browse files Browse the repository at this point in the history
  • Loading branch information
hughperkins committed Aug 5, 2016
1 parent 02955f7 commit 894030c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions closeondelete.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import sublime_plugin
import sublime
import os


class MyEvents(sublime_plugin.EventListener):
def on_activated(self, view):
if view.is_dirty():
return
filename = view.file_name()
if not os.path.exists(filename):
view.set_scratch(True)
sublime.set_timeout(lambda: view.window().run_command("close_file"), 0)

0 comments on commit 894030c

Please sign in to comment.