@@ -133,7 +133,6 @@ public bool CheckVersionAtStartup
133
133
}
134
134
135
135
private bool _compileBeforeParse ;
136
-
137
136
public bool CompileBeforeParse
138
137
{
139
138
get => _compileBeforeParse ;
@@ -146,22 +145,33 @@ public bool CompileBeforeParse
146
145
147
146
if ( value && _vbeSettings . CompileOnDemand )
148
147
{
149
- var result = _messageBox . Show ( RubberduckUI . GeneralSettings_CompileBeforeParse_WarnCompileOnDemandEnabled ,
150
- RubberduckUI . GeneralSettings_CompileBeforeParse_WarnCompileOnDemandEnabled_Caption , MessageBoxButtons . YesNo ,
151
- MessageBoxIcon . Exclamation , MessageBoxDefaultButton . Button1 ) ;
152
- if ( result == DialogResult . No )
148
+ if ( ! SynchronizeVBESettings ( ) )
153
149
{
154
150
return ;
155
151
}
156
-
157
- _vbeSettings . CompileOnDemand = false ;
158
152
}
159
153
160
154
_compileBeforeParse = value ;
161
155
OnPropertyChanged ( ) ;
162
156
}
163
157
}
164
158
159
+ private bool SynchronizeVBESettings ( )
160
+ {
161
+ var result = _messageBox . Show ( RubberduckUI . GeneralSettings_CompileBeforeParse_WarnCompileOnDemandEnabled ,
162
+ RubberduckUI . GeneralSettings_CompileBeforeParse_WarnCompileOnDemandEnabled_Caption , MessageBoxButtons . YesNo ,
163
+ MessageBoxIcon . Exclamation , MessageBoxDefaultButton . Button1 ) ;
164
+
165
+ if ( result == DialogResult . No )
166
+ {
167
+ return false ;
168
+ }
169
+
170
+ _vbeSettings . CompileOnDemand = false ;
171
+ _vbeSettings . BackGroundCompile = false ;
172
+ return true ;
173
+ }
174
+
165
175
private int _autoSavePeriod ;
166
176
public int AutoSavePeriod
167
177
{
0 commit comments