Skip to content

Commit

Permalink
Renamed some variables
Browse files Browse the repository at this point in the history
  • Loading branch information
sdicke committed Feb 1, 2018
1 parent 3ed8ff8 commit e6c9c26
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 132 deletions.
16 changes: 8 additions & 8 deletions markdownhighlighter.cpp
Expand Up @@ -398,8 +398,8 @@ void MarkdownHighlighter::highlightMarkdown(QString text) {
* @param text
*/
void MarkdownHighlighter::highlightHeadline(QString text) {
QRegularExpression re("^(#+)\\s+(.+?)$");
QRegularExpressionMatch match = re.match(text);
QRegularExpression regex("^(#+)\\s+(.+?)$");
QRegularExpressionMatch match = regex.match(text);
QTextCharFormat &maskedFormat = _formats[HighlighterState::MaskedSyntax];

// check for headline blocks with # in front of them
Expand Down Expand Up @@ -560,8 +560,8 @@ void MarkdownHighlighter::setCurrentBlockMargin(
* @param text
*/
void MarkdownHighlighter::highlightCodeBlock(QString text) {
QRegularExpression re("^```\\w*?$");
QRegularExpressionMatch match = re.match(text);
QRegularExpression regex("^```\\w*?$");
QRegularExpressionMatch match = regex.match(text);

if (match.hasMatch()) {
setCurrentBlockState(
Expand Down Expand Up @@ -629,20 +629,20 @@ void MarkdownHighlighter::highlightAdditionalRules(
}

QRegularExpression expression(rule.pattern);
QRegularExpressionMatchIterator i = expression.globalMatch(text);
QRegularExpressionMatchIterator iterator = expression.globalMatch(text);
int capturingGroup = rule.capturingGroup;
int maskedGroup = rule.maskedGroup;
QTextCharFormat &format = _formats[rule.state];

// store the current block state if useStateAsCurrentBlockState
// is set
if (i.hasNext() && rule.useStateAsCurrentBlockState) {
if (iterator.hasNext() && rule.useStateAsCurrentBlockState) {
setCurrentBlockState(rule.state);
}

// find and format all occurrences
while (i.hasNext()) {
QRegularExpressionMatch match = i.next();
while (iterator.hasNext()) {
QRegularExpressionMatch match = iterator.next();

// if there is a capturingGroup set then first highlight
// everything as MaskedSyntax and highlight capturingGroup
Expand Down

0 comments on commit e6c9c26

Please sign in to comment.