fix: color for line break glyphs

This commit is contained in:
Roy Qu 2024-02-28 20:13:20 +08:00
parent ca79bf6648
commit 46f5191b89
2 changed files with 4 additions and 3 deletions

View File

@ -21,7 +21,7 @@ const QSet<QChar> WordBreakChars{'.', ',', ';', ':',
'"', '\'', '!', '?', '[', ']', '(', ')', '{', '}', '^', '-', '=', '+',
'-', '*', '/', '\\', '|'};
const QChar TabGlyph(0x2192);
const QChar SpaceGlyph('.');
const QChar SpaceGlyph(0x02FD);
const QChar LineBreakGlyph(0x21A9);
const QChar SoftBreakGlyph(0x2193);
}

View File

@ -1118,6 +1118,8 @@ void QSynEditPainter::paintLines()
foldRange = mEdit->foldStartAtLine(vLine);
if ((foldRange) && foldRange->collapsed) {
addOnStr = mEdit->syntaxer()->foldString(sLine);
attr = mEdit->mSyntaxer->symbolAttribute();
getBraceColorAttr(mEdit->mSyntaxer->getState().braceLevel,attr);
} else {
// Draw LineBreak glyph.
if (mEdit->mOptions.testFlag(eoShowLineBreaks)
@ -1125,6 +1127,7 @@ void QSynEditPainter::paintLines()
&& (!mIsSpecialLine)
&& (mEdit->mDocument->lineWidth(vLine-1) < mRight)) {
addOnStr = LineBreakGlyph;
attr = mEdit->mSyntaxer->whitespaceAttribute();
}
}
if (!addOnStr.isEmpty()) {
@ -1133,8 +1136,6 @@ void QSynEditPainter::paintLines()
for (int i=0;i<len;i++) {
glyphStartPositionsList.append(tokenLeft);
}
attr = mEdit->mSyntaxer->symbolAttribute();
getBraceColorAttr(mEdit->mSyntaxer->getState().braceLevel,attr);
int oldLen = sLine.length();
sLine += addOnStr;
addHighlightToken(