Commit c7ba0e6 1 parent c3a2766 commit c7ba0e6 Copy full SHA for c7ba0e6
File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 7
7
from __future__ import unicode_literals
8
8
9
9
from os import path
10
+ from sublime import windows
10
11
from sublime_plugin import EventListener
11
12
12
13
from .commands import *
18
19
from .libraries .project_check import ProjectCheck
19
20
20
21
def plugin_loaded ():
22
+ # Load or fix the right deviot syntax file
23
+ for window in windows ():
24
+ for view in window .views ():
25
+ set_deviot_syntax (view )
26
+
27
+ # Install PlatformIO
21
28
PioInstall ()
29
+
30
+ # Search updates
22
31
Update ().check_update_async ()
23
32
24
33
menu_path = getMainMenuPath ()
Original file line number Diff line number Diff line change @@ -162,16 +162,22 @@ def set_deviot_syntax(view):
162
162
if (not ProjectCheck ().is_iot ()):
163
163
return
164
164
165
+ d_syntax = 'Packages/Deviot/deviot.sublime-syntax'
166
+
165
167
syntax = view .settings ().get ('syntax' )
166
168
169
+ if (syntax .endswith ('Arduino.tmLanguage' )):
170
+ view .settings ().set ('syntax' , d_syntax )
171
+ return
172
+
167
173
if (not syntax or not syntax .endswith ('/deviot.sublime-syntax' )):
168
- from .path import getPluginPath
174
+ from .paths import getPluginPath
169
175
170
176
deviot_syntax = getPluginPath ()
171
177
deviot_syntax = path .join (deviot_syntax , 'deviot.sublime-syntax' )
172
178
173
179
if (path .exists (deviot_syntax )):
174
- view .settings ().set ('syntax' , 'Packages/Deviot/deviot.sublime-syntax' )
180
+ view .settings ().set ('syntax' , d_syntax )
175
181
176
182
177
183
def singleton (cls ):
You can’t perform that action at this time.
0 commit comments