Skip to content

Commit cd85bca

Browse files
committed
isolating the highlighted text change
1 parent 9ef8170 commit cd85bca

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/osltoy/codeeditor.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ CodeEditor::CodeEditor(QWidget* parent, const std::string& filename)
6464

6565
updateLineNumberAreaWidth(0);
6666
highlightCurrentLine();
67-
setTabStopDistance(4 * char_width_pixels());
6867
}
6968

7069

@@ -99,12 +98,11 @@ CodeEditor::text_string() const
9998
int
10099
CodeEditor::char_width_pixels() const
101100
{
102-
QFontMetrics metrics(fixedFont());
103101
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
104-
return metrics.horizontalAdvance(QLatin1Char('M'));
102+
return fontMetrics().horizontalAdvance(QLatin1Char('M'));
105103
#else
106104
// QFontMetric.width() deprecated from 5.11, marked as such in 5.13
107-
return metrics.width(QLatin1Char('M'));
105+
return fontMetrics().width(QLatin1Char('M'));
108106
#endif
109107
}
110108

0 commit comments

Comments
 (0)