@@ -277,89 +277,103 @@ BOOL CViewTextFileDlg::OnInitDialog()
277
277
}
278
278
else
279
279
{
280
- if (_tcsicmp (lpszExtension, _T (" .m " )) == 0 )
280
+ if (_tcsicmp (lpszExtension, _T (" .json " )) == 0 )
281
281
{
282
- // Create the Matlab Lexer
282
+ // Create the JSON Lexer
283
283
#pragma warning(suppress: 26429)
284
- m_pLexer = theApp.m_pCreateLexer (" matlab " );
284
+ m_pLexer = theApp.m_pCreateLexer (" json " );
285
285
if (m_pLexer == nullptr )
286
286
return FALSE ;
287
287
288
- // Setup the Matlab Lexer
288
+ // Setup the JSON Lexer
289
289
m_ctrlTextFile.SetILexer (m_pLexer);
290
- m_ctrlTextFile.SetKeyWords (0 , g_matlabKeywords);
291
290
}
292
291
else
293
292
{
294
- if (_tcsicmp (lpszExtension, _T (" .md " )) == 0 )
293
+ if (_tcsicmp (lpszExtension, _T (" .m " )) == 0 )
295
294
{
296
- // Create the MD Lexer
295
+ // Create the Matlab Lexer
297
296
#pragma warning(suppress: 26429)
298
- m_pLexer = theApp.m_pCreateLexer (" markdown " );
297
+ m_pLexer = theApp.m_pCreateLexer (" matlab " );
299
298
if (m_pLexer == nullptr )
300
299
return FALSE ;
301
300
302
- // Setup the MD Lexer
301
+ // Setup the Matlab Lexer
303
302
m_ctrlTextFile.SetILexer (m_pLexer);
303
+ m_ctrlTextFile.SetKeyWords (0 , g_matlabKeywords);
304
304
}
305
305
else
306
306
{
307
- if (_tcsicmp (lpszExtension, _T (" .py " )) == 0 )
307
+ if (_tcsicmp (lpszExtension, _T (" .md " )) == 0 )
308
308
{
309
- // Create the Python Lexer
309
+ // Create the MD Lexer
310
310
#pragma warning(suppress: 26429)
311
- m_pLexer = theApp.m_pCreateLexer (" python " );
311
+ m_pLexer = theApp.m_pCreateLexer (" markdown " );
312
312
if (m_pLexer == nullptr )
313
313
return FALSE ;
314
314
315
- // Setup the Python Lexer
315
+ // Setup the MD Lexer
316
316
m_ctrlTextFile.SetILexer (m_pLexer);
317
- m_ctrlTextFile.SetKeyWords (0 , g_pyKeywords);
318
317
}
319
318
else
320
319
{
321
- if (_tcsicmp (lpszExtension, _T (" .sh " )) == 0 )
320
+ if (_tcsicmp (lpszExtension, _T (" .py " )) == 0 )
322
321
{
323
- // Create the Shell Lexer
322
+ // Create the Python Lexer
324
323
#pragma warning(suppress: 26429)
325
- m_pLexer = theApp.m_pCreateLexer (" bash " );
324
+ m_pLexer = theApp.m_pCreateLexer (" python " );
326
325
if (m_pLexer == nullptr )
327
326
return FALSE ;
328
327
329
- // Setup the Shell Lexer
328
+ // Setup the Python Lexer
330
329
m_ctrlTextFile.SetILexer (m_pLexer);
330
+ m_ctrlTextFile.SetKeyWords (0 , g_pyKeywords);
331
331
}
332
332
else
333
333
{
334
- if (_tcsicmp (lpszExtension, _T (" .sql " )) == 0 )
334
+ if (_tcsicmp (lpszExtension, _T (" .sh " )) == 0 )
335
335
{
336
- // Create the SQL Lexer
336
+ // Create the Shell Lexer
337
337
#pragma warning(suppress: 26429)
338
- m_pLexer = theApp.m_pCreateLexer (" sql " );
338
+ m_pLexer = theApp.m_pCreateLexer (" bash " );
339
339
if (m_pLexer == nullptr )
340
340
return FALSE ;
341
341
342
- // Setup the SQL Lexer
342
+ // Setup the Shell Lexer
343
343
m_ctrlTextFile.SetILexer (m_pLexer);
344
- m_ctrlTextFile.SetKeyWords (0 , g_sqlKeywords);
345
344
}
346
345
else
347
346
{
348
- if (_tcsicmp (lpszExtension, _T (" .xml " )) == 0 )
347
+ if (_tcsicmp (lpszExtension, _T (" .sql " )) == 0 )
349
348
{
350
- // Create the XML Lexer
349
+ // Create the SQL Lexer
351
350
#pragma warning(suppress: 26429)
352
- m_pLexer = theApp.m_pCreateLexer (" xml " );
351
+ m_pLexer = theApp.m_pCreateLexer (" sql " );
353
352
if (m_pLexer == nullptr )
354
353
return FALSE ;
355
354
356
- // Setup the XML Lexer
355
+ // Setup the SQL Lexer
357
356
m_ctrlTextFile.SetILexer (m_pLexer);
357
+ m_ctrlTextFile.SetKeyWords (0 , g_sqlKeywords);
358
358
}
359
359
else
360
360
{
361
- m_ctrlTextFile.SetupDirectAccess ();
362
- m_ctrlTextFile.SetILexer (nullptr );
361
+ if (_tcsicmp (lpszExtension, _T (" .xml" )) == 0 )
362
+ {
363
+ // Create the XML Lexer
364
+ #pragma warning(suppress: 26429)
365
+ m_pLexer = theApp.m_pCreateLexer (" xml" );
366
+ if (m_pLexer == nullptr )
367
+ return FALSE ;
368
+
369
+ // Setup the XML Lexer
370
+ m_ctrlTextFile.SetILexer (m_pLexer);
371
+ }
372
+ else
373
+ {
374
+ m_ctrlTextFile.SetupDirectAccess ();
375
+ m_ctrlTextFile.SetILexer (nullptr );
376
+ }
363
377
}
364
378
}
365
379
}
0 commit comments