diff --git a/libs/qsynedit/qsynedit/document.h b/libs/qsynedit/qsynedit/document.h index 282ff445..ec66b126 100644 --- a/libs/qsynedit/qsynedit/document.h +++ b/libs/qsynedit/qsynedit/document.h @@ -540,7 +540,13 @@ public: } int tabWidth() const { - return mTabSize * mSpaceWidth; + return mTabSize * spaceWidth(); + } + + int spaceWidth() const { + if (mForceMonospace) + return mCharWidth; + return mSpaceWidth; } void setTabSize(int newTabSize); diff --git a/libs/qsynedit/qsynedit/painter.cpp b/libs/qsynedit/qsynedit/painter.cpp index 5e5953cc..67d36899 100644 --- a/libs/qsynedit/qsynedit/painter.cpp +++ b/libs/qsynedit/qsynedit/painter.cpp @@ -761,7 +761,7 @@ void QSynEditPainter::paintFoldAttributes() tabSteps = 0; indentLevel = 0; while (tabSteps < lineIndent) { - X = tabSteps * mEdit->mCharWidth + mEdit->textOffset() - 1; + X = tabSteps * mEdit->mDocument->spaceWidth() + mEdit->textOffset() - 1; tabSteps+=mEdit->tabSize(); indentLevel++ ; if (mEdit->mSyntaxer) {