- enhancement: treat files ended with ".C" or ".CPP" as C++ files

This commit is contained in:
Roy Qu 2021-11-27 10:25:27 +08:00
parent dfce6e7146
commit 5d728c36d5
3 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,6 @@
Version 0.10.3 For Dev-C++ 7 Beta
- enhancement: treat files ended with ".C" or ".CPP" as C++ files
Version 0.10.2 For Dev-C++ 7 Beta
- fix: select by mouse can't correctly set mouse's column position
- fix: dragging out of the editor and back will cause error

View File

@ -22,7 +22,9 @@ PSynHighlighter HighlighterManager::getHighlighter(const QString &filename)
QString suffix = info.suffix();
if (suffix.isEmpty() || suffix == "c" || suffix == "cpp" || suffix == "cxx"
|| suffix == "cc" || suffix == "h" || suffix == "hpp"
|| suffix == "hxx" || suffix == "hh") {
|| suffix == "hxx" || suffix == "hh" || suffix == "C"
|| suffix == "CPP" || suffix =="H" || suffix == "c++"
|| suffix == "h++") {
return getCppHighlighter();
}
}

View File

@ -191,6 +191,12 @@ FileType getFileType(const QString &filename)
if (filename.endsWith(".dev",PATH_SENSITIVITY)) {
return FileType::Project;
}
if (filename.endsWith(".C")) {
return FileType::CppSource;
}
if (filename.endsWith(".CPP")) {
return FileType::CppSource;
}
if (filename.endsWith(".c",PATH_SENSITIVITY)) {
return FileType::CSource;
}
@ -206,6 +212,9 @@ FileType getFileType(const QString &filename)
if (filename.endsWith(".c++",PATH_SENSITIVITY)) {
return FileType::CppSource;
}
if (filename.endsWith(".H")) {
return FileType::CHeader;
}
if (filename.endsWith(".h",PATH_SENSITIVITY)) {
return FileType::CHeader;
}