-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
43 lines (31 loc) · 1.34 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import sublime, sublime_plugin
def plugin_loaded():
# Set flags to `false` on plugin load.
set_setting('fss_on_full_screen', False)
set_setting('fss_on_distraction_free', False)
def plugin_unloaded():
remove_setting('fss_on_full_screen')
remove_setting('fss_on_distraction_free')
def get_setting(setting):
return sublime.active_window().settings().get(setting)
def set_setting(setting, value):
sublime.active_window().settings().set(setting, value)
def remove_setting(setting):
sublime.active_window().settings().erase(setting)
class ToggleFullScreenWrapperCommand(sublime_plugin.WindowCommand):
def run(self):
if get_setting('fss_on_full_screen'):
set_setting('fss_on_full_screen', False)
elif get_setting('fss_on_distraction_free'):
set_setting('fss_on_distraction_free', False)
else:
set_setting('fss_on_full_screen', True)
self.window.run_command("toggle_full_screen")
class ToggleDistractionFreeWrapperCommand(sublime_plugin.WindowCommand):
def run(self):
if get_setting('fss_on_distraction_free'):
set_setting('fss_on_distraction_free', False)
else:
set_setting('fss_on_full_screen', False)
set_setting('fss_on_distraction_free', True)
self.window.run_command("toggle_distraction_free")