@@ -222,67 +222,69 @@ class State {
222
222
update ( update : StateDelta ) : StateChange {
223
223
const change = new StateChange ( ) ;
224
224
225
- if ( update . type === 'selectionStatus' ) {
226
- if ( this . _selectionStatus !== update . selectionStatus ) {
227
- this . _selectionStatus = update . selectionStatus ;
228
- change . selectionStatus = true ;
229
- }
230
- }
225
+ switch ( update . type ) {
226
+ case 'selectionStatus' :
227
+ if ( this . _selectionStatus !== update . selectionStatus ) {
228
+ this . _selectionStatus = update . selectionStatus ;
229
+ change . selectionStatus = true ;
230
+ }
231
+ break ;
231
232
232
- if ( update . type === 'indentation' ) {
233
- if ( this . _indentation !== update . indentation ) {
234
- this . _indentation = update . indentation ;
235
- change . indentation = true ;
236
- }
237
- }
233
+ case 'indentation' :
234
+ if ( this . _indentation !== update . indentation ) {
235
+ this . _indentation = update . indentation ;
236
+ change . indentation = true ;
237
+ }
238
+ break ;
238
239
239
- if ( update . type === 'languageId' ) {
240
- if ( this . _languageId !== update . languageId ) {
241
- this . _languageId = update . languageId ;
242
- change . languageId = true ;
243
- }
244
- }
240
+ case 'languageId' :
241
+ if ( this . _languageId !== update . languageId ) {
242
+ this . _languageId = update . languageId ;
243
+ change . languageId = true ;
244
+ }
245
+ break ;
245
246
246
- if ( update . type === 'encoding' ) {
247
- if ( this . _encoding !== update . encoding ) {
248
- this . _encoding = update . encoding ;
249
- change . encoding = true ;
250
- }
251
- }
247
+ case 'encoding' :
248
+ if ( this . _encoding !== update . encoding ) {
249
+ this . _encoding = update . encoding ;
250
+ change . encoding = true ;
251
+ }
252
+ break ;
252
253
253
- if ( update . type === 'EOL' ) {
254
- if ( this . _EOL !== update . EOL ) {
255
- this . _EOL = update . EOL ;
256
- change . EOL = true ;
257
- }
258
- }
254
+ case 'EOL' :
255
+ if ( this . _EOL !== update . EOL ) {
256
+ this . _EOL = update . EOL ;
257
+ change . EOL = true ;
258
+ }
259
+ break ;
259
260
260
- if ( update . type === 'tabFocusMode' ) {
261
- if ( this . _tabFocusMode !== update . tabFocusMode ) {
262
- this . _tabFocusMode = update . tabFocusMode ;
263
- change . tabFocusMode = true ;
264
- }
265
- }
261
+ case 'tabFocusMode' :
262
+ if ( this . _tabFocusMode !== update . tabFocusMode ) {
263
+ this . _tabFocusMode = update . tabFocusMode ;
264
+ change . tabFocusMode = true ;
265
+ }
266
+ break ;
266
267
267
- if ( update . type === 'columnSelectionMode' ) {
268
- if ( this . _columnSelectionMode !== update . columnSelectionMode ) {
269
- this . _columnSelectionMode = update . columnSelectionMode ;
270
- change . columnSelectionMode = true ;
271
- }
272
- }
268
+ case 'columnSelectionMode' :
269
+ if ( this . _columnSelectionMode !== update . columnSelectionMode ) {
270
+ this . _columnSelectionMode = update . columnSelectionMode ;
271
+ change . columnSelectionMode = true ;
272
+ }
273
+ break ;
273
274
274
- if ( update . type === 'screenReaderMode' ) {
275
- if ( this . _screenReaderMode !== update . screenReaderMode ) {
276
- this . _screenReaderMode = update . screenReaderMode ;
277
- change . screenReaderMode = true ;
278
- }
279
- }
275
+ case 'screenReaderMode' :
276
+ if ( this . _screenReaderMode !== update . screenReaderMode ) {
277
+ this . _screenReaderMode = update . screenReaderMode ;
278
+ change . screenReaderMode = true ;
279
+ }
280
+ break ;
280
281
281
- if ( update . type === 'metadata' ) {
282
- if ( this . _metadata !== update . metadata ) {
283
- this . _metadata = update . metadata ;
284
- change . metadata = true ;
285
- }
282
+ case 'metadata' :
283
+ if ( this . _metadata !== update . metadata ) {
284
+ this . _metadata = update . metadata ;
285
+ change . metadata = true ;
286
+ }
287
+ break ;
286
288
}
287
289
288
290
return change ;
0 commit comments