LanguageDefinition 明确允许注释字符串为空,但 ColorizeInternal() 没有正确处理这种合法状态。
将 TextEditor.cpp 中的 ColorizeInternal() 函数:
else if (!withinSingleLineComment && currentIndex + startStr.size() <= line.size() &&
equals(startStr.begin(), startStr.end(), from, from + startStr.size(), pred))
修改为(加上 startStr.size() > 0 &&):
else if (!withinSingleLineComment && startStr.size() > 0 && currentIndex + startStr.size() <= line.size() &&
equals(startStr.begin(), startStr.end(), from, from + startStr.size(), pred))
LanguageDefinition 明确允许注释字符串为空,但 ColorizeInternal() 没有正确处理这种合法状态。
将 TextEditor.cpp 中的 ColorizeInternal() 函数:
else if (!withinSingleLineComment && currentIndex + startStr.size() <= line.size() &&
equals(startStr.begin(), startStr.end(), from, from + startStr.size(), pred))
修改为(加上 startStr.size() > 0 &&):
else if (!withinSingleLineComment && startStr.size() > 0 && currentIndex + startStr.size() <= line.size() &&
equals(startStr.begin(), startStr.end(), from, from + startStr.size(), pred))