Skip to content

Commit 6788234

Browse files
committed
Enabled syntax highlighting for JSON files.
1 parent aa722ad commit 6788234

File tree

8 files changed

+45
-29
lines changed

8 files changed

+45
-29
lines changed

FileList.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ bool IsTextFile(CString strFilePath)
142142
(_tcsicmp(lpszExtension, _T(".html")) == 0) ||
143143
(_tcsicmp(lpszExtension, _T(".java")) == 0) ||
144144
(_tcsicmp(lpszExtension, _T(".js")) == 0) ||
145+
(_tcsicmp(lpszExtension, _T(".json")) == 0) ||
145146
(_tcsicmp(lpszExtension, _T(".log")) == 0) ||
146147
(_tcsicmp(lpszExtension, _T(".m")) == 0) ||
147148
(_tcsicmp(lpszExtension, _T(".md")) == 0) ||

IntelliFile.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ <h2>Supported Programming Languages</h2>
7272
<li>CSS</li>
7373
<li>HTML</li>
7474
<li>Java</li>
75+
<li>JSON</li>
7576
<li>MarkDown</li>
7677
<li>MATLAB</li>
7778
<li>PHP</li>

ViewTextFileDlg.cpp

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -277,89 +277,103 @@ BOOL CViewTextFileDlg::OnInitDialog()
277277
}
278278
else
279279
{
280-
if (_tcsicmp(lpszExtension, _T(".m")) == 0)
280+
if (_tcsicmp(lpszExtension, _T(".json")) == 0)
281281
{
282-
// Create the Matlab Lexer
282+
// Create the JSON Lexer
283283
#pragma warning(suppress: 26429)
284-
m_pLexer = theApp.m_pCreateLexer("matlab");
284+
m_pLexer = theApp.m_pCreateLexer("json");
285285
if (m_pLexer == nullptr)
286286
return FALSE;
287287

288-
// Setup the Matlab Lexer
288+
// Setup the JSON Lexer
289289
m_ctrlTextFile.SetILexer(m_pLexer);
290-
m_ctrlTextFile.SetKeyWords(0, g_matlabKeywords);
291290
}
292291
else
293292
{
294-
if (_tcsicmp(lpszExtension, _T(".md")) == 0)
293+
if (_tcsicmp(lpszExtension, _T(".m")) == 0)
295294
{
296-
// Create the MD Lexer
295+
// Create the Matlab Lexer
297296
#pragma warning(suppress: 26429)
298-
m_pLexer = theApp.m_pCreateLexer("markdown");
297+
m_pLexer = theApp.m_pCreateLexer("matlab");
299298
if (m_pLexer == nullptr)
300299
return FALSE;
301300

302-
// Setup the MD Lexer
301+
// Setup the Matlab Lexer
303302
m_ctrlTextFile.SetILexer(m_pLexer);
303+
m_ctrlTextFile.SetKeyWords(0, g_matlabKeywords);
304304
}
305305
else
306306
{
307-
if (_tcsicmp(lpszExtension, _T(".py")) == 0)
307+
if (_tcsicmp(lpszExtension, _T(".md")) == 0)
308308
{
309-
// Create the Python Lexer
309+
// Create the MD Lexer
310310
#pragma warning(suppress: 26429)
311-
m_pLexer = theApp.m_pCreateLexer("python");
311+
m_pLexer = theApp.m_pCreateLexer("markdown");
312312
if (m_pLexer == nullptr)
313313
return FALSE;
314314

315-
// Setup the Python Lexer
315+
// Setup the MD Lexer
316316
m_ctrlTextFile.SetILexer(m_pLexer);
317-
m_ctrlTextFile.SetKeyWords(0, g_pyKeywords);
318317
}
319318
else
320319
{
321-
if (_tcsicmp(lpszExtension, _T(".sh")) == 0)
320+
if (_tcsicmp(lpszExtension, _T(".py")) == 0)
322321
{
323-
// Create the Shell Lexer
322+
// Create the Python Lexer
324323
#pragma warning(suppress: 26429)
325-
m_pLexer = theApp.m_pCreateLexer("bash");
324+
m_pLexer = theApp.m_pCreateLexer("python");
326325
if (m_pLexer == nullptr)
327326
return FALSE;
328327

329-
// Setup the Shell Lexer
328+
// Setup the Python Lexer
330329
m_ctrlTextFile.SetILexer(m_pLexer);
330+
m_ctrlTextFile.SetKeyWords(0, g_pyKeywords);
331331
}
332332
else
333333
{
334-
if (_tcsicmp(lpszExtension, _T(".sql")) == 0)
334+
if (_tcsicmp(lpszExtension, _T(".sh")) == 0)
335335
{
336-
// Create the SQL Lexer
336+
// Create the Shell Lexer
337337
#pragma warning(suppress: 26429)
338-
m_pLexer = theApp.m_pCreateLexer("sql");
338+
m_pLexer = theApp.m_pCreateLexer("bash");
339339
if (m_pLexer == nullptr)
340340
return FALSE;
341341

342-
// Setup the SQL Lexer
342+
// Setup the Shell Lexer
343343
m_ctrlTextFile.SetILexer(m_pLexer);
344-
m_ctrlTextFile.SetKeyWords(0, g_sqlKeywords);
345344
}
346345
else
347346
{
348-
if (_tcsicmp(lpszExtension, _T(".xml")) == 0)
347+
if (_tcsicmp(lpszExtension, _T(".sql")) == 0)
349348
{
350-
// Create the XML Lexer
349+
// Create the SQL Lexer
351350
#pragma warning(suppress: 26429)
352-
m_pLexer = theApp.m_pCreateLexer("xml");
351+
m_pLexer = theApp.m_pCreateLexer("sql");
353352
if (m_pLexer == nullptr)
354353
return FALSE;
355354

356-
// Setup the XML Lexer
355+
// Setup the SQL Lexer
357356
m_ctrlTextFile.SetILexer(m_pLexer);
357+
m_ctrlTextFile.SetKeyWords(0, g_sqlKeywords);
358358
}
359359
else
360360
{
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+
}
363377
}
364378
}
365379
}

hlp/IntelliFile.chm

0 Bytes
Binary file not shown.

x64/Release/IntelliFile.chm

2 Bytes
Binary file not shown.

x64/Release/IntelliFile.exe

0 Bytes
Binary file not shown.

x64/Release/Lexilla.dll

0 Bytes
Binary file not shown.

x64/Release/Scintilla.dll

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)