- fix: Font style not applied when option "show spaces" is on.
Update Contributor info
This commit is contained in:
parent
af11c6df32
commit
026a787ee5
|
@ -27,6 +27,10 @@ author: Alan-CRL
|
||||||
|
|
||||||
author: Alan-CRL
|
author: Alan-CRL
|
||||||
|
|
||||||
|
### Theme One Dark
|
||||||
|
|
||||||
|
author: 天依蓝(MZZW@github)
|
||||||
|
|
||||||
## Color Schemes
|
## Color Schemes
|
||||||
|
|
||||||
### Monokai
|
### Monokai
|
||||||
|
@ -40,3 +44,7 @@ author: PerryDing
|
||||||
### Ochre_Butter
|
### Ochre_Butter
|
||||||
|
|
||||||
author: PerryDing
|
author: PerryDing
|
||||||
|
|
||||||
|
### One Dark
|
||||||
|
|
||||||
|
author: 天依蓝(MZZW@github)
|
||||||
|
|
|
@ -1272,7 +1272,6 @@ void Editor::onPreparePaintHighlightToken(int line, int aChar, const QString &to
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//selection
|
//selection
|
||||||
if (syntaxer() && attr) {
|
if (syntaxer() && attr) {
|
||||||
if (attr->tokenType() == QSynedit::TokenType::Keyword) {
|
if (attr->tokenType() == QSynedit::TokenType::Keyword) {
|
||||||
|
|
|
@ -413,7 +413,6 @@ void QSynEditPainter::paintToken(
|
||||||
mPainter->setFont(font);
|
mPainter->setFont(font);
|
||||||
fontInited = true;
|
fontInited = true;
|
||||||
}
|
}
|
||||||
//qDebug()<<"paint 1:"<<textToPaint;
|
|
||||||
mPainter->drawText(nX,mRcToken.bottom()-mPainter->fontMetrics().descent() , textToPaint);
|
mPainter->drawText(nX,mRcToken.bottom()-mPainter->fontMetrics().descent() , textToPaint);
|
||||||
drawed = true;
|
drawed = true;
|
||||||
}
|
}
|
||||||
|
@ -518,7 +517,6 @@ void QSynEditPainter::paintHighlightToken(const QString& lineText,
|
||||||
bool isComplexToken;
|
bool isComplexToken;
|
||||||
int nC1, nC2, nC1Sel, nC2Sel;
|
int nC1, nC2, nC1Sel, nC2Sel;
|
||||||
bool bU1, bSel, bU2;
|
bool bU1, bSel, bU2;
|
||||||
int nX1, nX2;
|
|
||||||
// Compute some helper variables.
|
// Compute some helper variables.
|
||||||
nC1 = std::max(mLeft, mTokenAccu.left);
|
nC1 = std::max(mLeft, mTokenAccu.left);
|
||||||
nC2 = std::min(mRight, mTokenAccu.left + mTokenAccu.width);
|
nC2 = std::min(mRight, mTokenAccu.left + mTokenAccu.width);
|
||||||
|
@ -665,12 +663,12 @@ void QSynEditPainter::addHighlightToken(
|
||||||
bool bCanAppend = false;
|
bool bCanAppend = false;
|
||||||
bool bInitFont = (mTokenAccu.width==0);
|
bool bInitFont = (mTokenAccu.width==0);
|
||||||
if (mTokenAccu.width > 0 ) {
|
if (mTokenAccu.width > 0 ) {
|
||||||
if (showGlyphs == mTokenAccu.showSpecialGlyphs) {
|
|
||||||
// font style must be the same or token is only spaces
|
// font style must be the same or token is only spaces
|
||||||
if (mTokenAccu.style != style) {
|
if (mTokenAccu.style != style) {
|
||||||
bInitFont = true;
|
bInitFont = true;
|
||||||
} else {
|
} else {
|
||||||
if (
|
if (
|
||||||
|
(showGlyphs == mTokenAccu.showSpecialGlyphs) &&
|
||||||
// background color must be the same and
|
// background color must be the same and
|
||||||
(mTokenAccu.background == background) &&
|
(mTokenAccu.background == background) &&
|
||||||
// foreground color must be the same or token is only spaces
|
// foreground color must be the same or token is only spaces
|
||||||
|
@ -678,7 +676,6 @@ void QSynEditPainter::addHighlightToken(
|
||||||
bCanAppend = true;
|
bCanAppend = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// If we can't append it, then we have to paint the old token chars first.
|
// If we can't append it, then we have to paint the old token chars first.
|
||||||
if (!bCanAppend)
|
if (!bCanAppend)
|
||||||
paintHighlightToken(lineText, glyphStartCharList, glyphStartPositionList, false);
|
paintHighlightToken(lineText, glyphStartCharList, glyphStartPositionList, false);
|
||||||
|
@ -909,7 +906,6 @@ void QSynEditPainter::paintLines()
|
||||||
mLineSelStart = 0;
|
mLineSelStart = 0;
|
||||||
mLineSelEnd = 0;
|
mLineSelEnd = 0;
|
||||||
|
|
||||||
bool selToEnd = false;;
|
|
||||||
// Does the selection intersect the visible area?
|
// Does the selection intersect the visible area?
|
||||||
if (bAnySelection && (row >= mSelStart.row) && (row <= mSelEnd.row)) {
|
if (bAnySelection && (row >= mSelStart.row) && (row <= mSelEnd.row)) {
|
||||||
// Default to a fully selected line. This is correct for the smLine
|
// Default to a fully selected line. This is correct for the smLine
|
||||||
|
@ -937,8 +933,6 @@ void QSynEditPainter::paintLines()
|
||||||
mLineSelEnd = xpos;
|
mLineSelEnd = xpos;
|
||||||
mIsComplexLine = true;
|
mIsComplexLine = true;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
selToEnd = true;
|
|
||||||
}
|
}
|
||||||
} //endif bAnySelection
|
} //endif bAnySelection
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue