[DEBUG] Correct highlight of the C++ and lua

This commit is contained in:
2017-08-04 21:01:01 +02:00
parent d8b43a1f78
commit 34af3f6bb2
4 changed files with 11 additions and 9 deletions

View File

@@ -122,7 +122,7 @@ appl::Highlight::~Highlight() {
bool appl::Highlight::isCompatible(const std::string& _name) {
for (auto &it : m_listExtentions) {
APPL_DEBUG(" check : " << it << "=?=" << _name);
APPL_WARNING(" check : " << it << "=?=" << _name);
// TODO: Remove dependency with the std::regex ...
std::regex expression;
try {
@@ -136,7 +136,7 @@ bool appl::Highlight::isCompatible(const std::string& _name) {
if (resultMatch.size() <= 0) {
continue;
}
APPL_DEBUG(" - begin=" << std::distance(_name.begin(), resultMatch[0].first) << " end=" << std::distance(_name.begin(), resultMatch[0].second));
APPL_WARNING(" - begin=" << std::distance(_name.begin(), resultMatch[0].first) << " end=" << std::distance(_name.begin(), resultMatch[0].second));
if (resultMatch[0].first != _name.begin()) {
continue;
}

View File

@@ -52,14 +52,12 @@ void appl::highlightManager::init() {
}
}
// display :
/*
for (auto &it : hlList) {
if (it == nullptr) {
continue;
}
it->display();
}
*/
}
void appl::highlightManager::unInit() {
@@ -76,15 +74,15 @@ std::string appl::highlightManager::getTypeFile(const std::string& _fileName) {
if (_fileName.size() == 0) {
return "";
}
APPL_DEBUG("Try to find type for extention : '" << _fileName << "' in " << s_list().size() << " types");
APPL_WARNING("Try to find type for extention : '" << _fileName << "' in " << s_list().size() << " types");
std::vector<ememory::SharedPtr<Highlight>>& hlList = s_list();
for (auto &it : hlList) {
if (it == nullptr) {
continue;
}
APPL_DEBUG(" check : " << it->getTypeName());
APPL_WARNING(" check : " << it->getTypeName());
if (it->isCompatible(_fileName) == true) {
APPL_DEBUG("Find type for extention : " << _fileName << " type : " << it->getTypeName());
APPL_WARNING("Find type for extention : " << _fileName << " type : " << it->getTypeName());
return it->getTypeName();
}
}