File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -679,3 +679,25 @@ def on_selection_modified(self, view):
679
679
cmd = PhpcsCommand .instance (view , False )
680
680
if isinstance (cmd , PhpcsCommand ):
681
681
cmd .set_status_bar ()
682
+
683
+ def on_pre_save (self , view ):
684
+ current_project_file = sublime .active_window ().project_file_name ();
685
+
686
+ if current_project_file == None :
687
+ debug_message ('Skipping config reload because no project file is loaded' )
688
+ return
689
+
690
+ if hasattr (pref , 'last_project_file' ):
691
+ last_project_file = pref .last_project_file
692
+ else :
693
+ last_project_file = None
694
+
695
+ debug_message ('Current project file: ' + str (current_project_file ));
696
+ debug_message ('Last project file: ' + str (last_project_file ));
697
+
698
+ if last_project_file == current_project_file :
699
+ debug_message ('Skipping reload. Project file did not change' )
700
+ else :
701
+ debug_message ('Reloading config because the project changed' )
702
+ pref .load ();
703
+ setattr (pref , 'last_project_file' , current_project_file )
You can’t perform that action at this time.
0 commit comments