Skip to content

边界条件 Bug #173

Description

@upkkmkk

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions