Skip to content

Commit

Permalink
Support syntax highlighting for "LLVMBuild.txt" (INI file), "Kbuild" …
Browse files Browse the repository at this point in the history
…(Makefile) and "Kconfig" (Configuration file).
  • Loading branch information
zufuliu committed Nov 16, 2018
1 parent 57b0396 commit 75fc3b0
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/Styles.c
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,15 @@ static PEDITLEXER Style_GetLexerFromFile(HWND hwnd, LPCWSTR lpszFile, BOOL bCGIG
}
}

if (!bFound && StrCaseEqual(lpszExt, L"txt")) {
bFound = TRUE;
if (StrCaseEqual(lpszName, L"CMakeLists.txt") || StrCaseEqual(lpszName, L"CMakeCache.txt")) {
pLexNew = &lexCMake;
} else if (StrCaseEqual(lpszName, L"LLVMBuild.txt")) {
pLexNew = &lexINI;
}
}

if (!bFound && ((StrCaseEqual(lpszExt, L"conf") && StrNCaseEqual(lpszName, L"httpd", 5)) || StrCaseEqual(lpszExt, L"htaccess"))) {
pLexNew = &lexCONF;
bFound = TRUE;
Expand All @@ -1802,7 +1811,7 @@ static PEDITLEXER Style_GetLexerFromFile(HWND hwnd, LPCWSTR lpszFile, BOOL bCGIG
bFound = TRUE;
np2LexLangIndex = IDM_LANG_WEB_NET;
}
if (!bFound && (StrCaseEqual(lpszName, L"CMakeLists.txt") || StrCaseEqual(lpszName, L"CMakeCache.txt") || StrRStrI(lpszFile, NULL, L".cmake.in"))) {
if (!bFound && StrRStrI(lpszFile, NULL, L".cmake.in")) {
pLexNew = &lexCMake;
bFound = TRUE;
}
Expand Down Expand Up @@ -1830,7 +1839,7 @@ static PEDITLEXER Style_GetLexerFromFile(HWND hwnd, LPCWSTR lpszFile, BOOL bCGIG
pLexNew = &lexDefault;
bFound = TRUE;
}
if (!bFound && StrNCaseEqual(lpszName, L"Makefile", 8)) {
if (!bFound && (StrNCaseEqual(lpszName, L"Makefile", 8) || StrNCaseEqual(lpszName, L"Kbuild", 6))) {
pLexNew = &lexMake;
bFound = TRUE;
}
Expand All @@ -1847,6 +1856,10 @@ static PEDITLEXER Style_GetLexerFromFile(HWND hwnd, LPCWSTR lpszFile, BOOL bCGIG
pLexNew = &lexJAM;
bFound = TRUE;
}
if (!bFound && StrNCaseEqual(lpszName, L"Kconfig", 7)) {
pLexNew = &lexCONF;
bFound = TRUE;
}
}

if (!bFound && pszExt) {
Expand Down

0 comments on commit 75fc3b0

Please sign in to comment.