forked from SublimeText/LaTeXTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoggle_auto.py
More file actions
executable file
·29 lines (23 loc) · 846 Bytes
/
toggle_auto.py
File metadata and controls
executable file
·29 lines (23 loc) · 846 Bytes
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
# ST2/ST3 compat
from __future__ import print_function
import sublime
if sublime.version() < '3000':
# we are on ST2 and Python 2.X
_ST3 = False
else:
_ST3 = True
import sublime_plugin
# Toggle focus after jumping to PDF
class ToggleAutoCommand(sublime_plugin.TextCommand):
def run(self, edit, which, **args):
print ("Toggling Auto " + which)
s = sublime.load_settings("LaTeXTools.sublime-settings")
prefs_auto = s.get(which+"_auto_trigger", True)
if self.view.settings().get(which + " auto trigger",prefs_auto):
self.view.settings().set(which + " auto trigger", False)
sublime.status_message(which + " auto trigger OFF")
print (which + " auto OFF")
else:
self.view.settings().set(which + " auto trigger", True)
sublime.status_message(which + " auto trigger ON")
print (which + " auto ON")