Skip to content

Commit

Permalink
Some minor cleaning up.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Feb 3, 2020
1 parent f4330e9 commit 7396401
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/plugins/editing/CellMLTextView/src/cellmltextviewlexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,30 +156,24 @@ void CellmlTextViewLexer::styleText(int pStart, int pEnd)
int end;

forever {
// Style a chunk of text
// Use a default style for our chunk of text
// Note: this is so that validString() can work properly...

end = qMin(start+StyleChunk, pEnd);

// Retrieve the chunk of text to style
applyStyle(start, end, Style::Default);

// Retrieve the chunk of text to style and style it

auto data = new char[end-start+1] {};

editor()->SendScintilla(QsciScintilla::SCI_GETTEXTRANGE,
start, end, data);

QByteArray text = data;
styleText(start, end, data, false);

delete[] data;

// Use a default style for our chunk of text
// Note: this is so that validString() can work properly...

applyStyle(start, end, Style::Default);

// Effectively style our chunk of text

styleText(start, end, text, false);

#ifdef QT_DEBUG
// Make sure that the end position of the last bit of chunk of text that
// we styled is end
Expand Down

0 comments on commit 7396401

Please sign in to comment.