Skip to content

Commit

Permalink
ticket:4310 Ignore the whitespace at the end.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Mar 14, 2017
1 parent d297532 commit 44b8b42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion OMEdit/OMEditGUI/Editors/ModelicaEditor.cpp
Expand Up @@ -542,7 +542,11 @@ void ModelicaHighlighter::highlightMultiLine(const QString &text)
if (blockState < 1 || blockState > 3) {
if (text[index] == ';') {
if (pTextBlockUserData) {
if (index == text.length() - 1) { // if we have some text after closing the annotation then we don't want to fold it.
QString endText = text.mid(index + 1);
/* if we have some text after closing the annotation then we don't want to fold it.
* ticket:4310 But if the ending text is just white space then fold it.
*/
if (index == text.length() - 1 || TabSettings::firstNonSpace(endText) == endText.length()) {
if (annotationIndex < 0) { // if we have one line annotation, we don't want to fold it.
pTextBlockUserData->setFoldingIndent(1);
}
Expand Down

0 comments on commit 44b8b42

Please sign in to comment.