SyntaxHighlighter: Fix crash when typing a quote at line end

in a py file.

Change-Id: Icfed4db68e1183ab19dbaf83ab5c9b6083f88fca
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Orgad Shaneh
2017-05-29 00:43:39 +03:00
committed by Orgad Shaneh
parent dabab693e9
commit b7e562d32b

View File

@@ -509,7 +509,7 @@ void SyntaxHighlighter::setFormatWithSpaces(const QString &text, int start, int
QTextCharFormat visualSpaceFormat = d->whitespaceFormat;
visualSpaceFormat.setBackground(format.background());
const int end = start + count;
const int end = std::min(start + count, text.length());
int index = start;
while (index != end) {