We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent df584c4 commit c09158dCopy full SHA for c09158d
1 file changed
lib/tokenlist.cpp
@@ -50,6 +50,9 @@ TokenList::TokenList(const Settings* settings) :
50
mSettings(settings)
51
{
52
mTokensFrontBack.list = this;
53
+ if (mSettings && (mSettings->enforcedLang != Settings::Language::None)) {
54
+ mLang = mSettings->enforcedLang;
55
+ }
56
}
57
58
TokenList::~TokenList()
@@ -80,9 +83,8 @@ void TokenList::deallocateTokens()
80
83
81
84
void TokenList::determineCppC()
82
85
- if (mSettings && (mSettings->enforcedLang != Settings::Language::None)) {
- mLang = mSettings->enforcedLang;
- } else {
86
+ // only try to determine it if it wasn't enforced
87
+ if (mLang == Settings::Language::None) {
88
if (Path::isC(getSourceFilePath()))
89
mLang = Settings::Language::C;
90
else if (Path::isCPP(getSourceFilePath()))
0 commit comments