ui: Fixed edge case in multiline CXX highlighting

This commit is contained in:
Eberhard Graether
2019-02-03 13:35:05 +01:00
parent 7d746ba947
commit 03573abc3b
2 changed files with 6 additions and 3 deletions
+2 -3
View File
@@ -379,12 +379,11 @@ std::vector<std::pair<int, int>> QtHighlighter::createMultiLineCommentRanges(
if (!isInRange(cursorStart.selectionEnd(), *ranges))
{
cursorStart.setPosition(cursorStart.selectionEnd() - 2);
break;
}
else
{
cursorStart.setPosition(cursorStart.selectionEnd() + 2);
cursorStart.setPosition(cursorStart.selectionEnd() + 1);
}
}
@@ -399,7 +398,7 @@ std::vector<std::pair<int, int>> QtHighlighter::createMultiLineCommentRanges(
break;
}
multiLineCommentRanges.push_back(std::pair<int, int>(cursorStart.position(), cursorEnd.position()));
multiLineCommentRanges.push_back(std::pair<int, int>(cursorStart.selectionStart(), cursorEnd.position()));
cursorStart = cursorEnd;
}
@@ -32,6 +32,10 @@ namespace SYNTAX_HIGHLIGHTER_TESTS
comment
// end */
/*/
comment
/*/
/* comment */ int no_comment; /* comment */
int no_comment2; /*