-
-
Save Rich-Harris/9077752 to your computer and use it in GitHub Desktop.
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, sublime_plugin | |
BUILD_COLOR_SCHEME = "Packages/Color Scheme - Default/Dawn.tmTheme" | |
def in_build_dir(view): | |
if not view or not view.file_name(): | |
return False | |
return "/build/" in view.file_name() | |
class GTFO(sublime_plugin.EventListener): | |
def on_modified(self, view=None): | |
if in_build_dir(view): | |
sublime.error_message("You're editing a file in the build folder. That's probably not what you want.") | |
def on_activated(self, view=None): | |
if in_build_dir(view): | |
view.settings().set("color_scheme", BUILD_COLOR_SCHEME) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment