User forums > Help
extension problem
liuyg:
HI,
Another problem! :D
I open MS SDK Sample file which extension is 'Cpp' with CB. But CB can't recognize it. No highlight, No source foler in project window.
All 'Cpp' file are in other folder.
thomas:
Hmm... was going to say that probably the lexer files are case sensitive, but that is not the case.
The guilty code pieces are in editorcolorset.cpp, lines 508-512:
void EditorColorSet::SetFileMasks(HighlightLanguage lang, const wxString& masks, const wxString& separator)
{
if (lang != HL_NONE)
m_Sets[lang].m_FileMasks = GetArrayFromString(masks.Lower(), separator);
}
and lines 265-277:
HighlightLanguage EditorColorSet::GetLanguageForFilename(const wxString& filename)
{
// first search in filemasks
for (int i = 0; i < HL_LAST; ++i)
{
for (unsigned int x = 0; x < m_Sets.m_FileMasks.GetCount(); ++x)
{
if (filename.Matches(m_Sets.m_FileMasks.Item(x)))
return i;
}
}
return HL_NONE;
}
wxString::Matches does clobbing, but is not case sensitive and is case sensitive (which is why it does not work).
Try replacing line 272 with:
--- Code: ---if (filename.Lower().Matches(m_Sets[i].m_FileMasks.Item(x)))
--- End code ---
and see if that works.
Then you may want to submit a bug report (or a patch) on SF so this is not forgotten ;)
liuyg:
OH, As you said, I find a bug! :)
I am only a normal user of CB and have not time to study CB source. In fact, I have not downloaded CB source. Can you submit a bug report to development team instead of me? This will make CB more perfect.
Thanks for your detail solution.
thomas:
done
rickg22:
the function Matches has an optional parameter to say it whether it should use case-insensitive comparisons.
Navigation
[0] Message Index
[#] Next page
Go to full version