1
1
#
2
2
# History:
3
3
#
4
+ # 05/15/2014:
5
+ # - Current view only saves if there are modifications
6
+ #
4
7
# 07/03/2013:
5
8
# - Changes to support Sublime Text 3 and Python 3
6
9
#
@@ -67,7 +70,7 @@ def run(self, edit, browser=None):
67
70
fileToOpen = self .view .file_name ()
68
71
69
72
#
70
- # If we've specified settings for a local server environment
73
+ # If we've specified settings for a local server environment
71
74
# use them
72
75
#
73
76
if projectSettings :
@@ -93,10 +96,12 @@ def run(self, edit, browser=None):
93
96
#
94
97
# Ensure the current view is saved
95
98
#
96
- self .view .window ().run_command ("save" )
99
+ if self .view .is_dirty ():
100
+ print ("File %s is dirty. Saving..." % (fileToOpen ,))
101
+ self .view .window ().run_command ("save" )
102
+
97
103
98
-
99
- #
104
+ #
100
105
# And open. If the settings file contains a valid selected browser use that
101
106
# command to open this file. Otherwise use the system default.
102
107
#
@@ -178,7 +183,7 @@ def getUserShellFolders(self):
178
183
import _winreg
179
184
else :
180
185
import winreg as _winreg
181
-
186
+
182
187
return_dict = {}
183
188
184
189
# First open the registry hive
@@ -197,7 +202,7 @@ def getUserShellFolders(self):
197
202
return return_dict
198
203
199
204
# Nothing failed above, so enumerate through all the Shell Folder values and return in a dictionary
200
- # This relies on error at end of
205
+ # This relies on error at end of
201
206
try :
202
207
for i in range (0 , _winreg .QueryInfoKey (Key )[1 ]):
203
208
name , value , val_type = _winreg .EnumValue (Key , i )
0 commit comments