CMakePM: Add support for block/endblock functions

The block() / endblock() functionatlity has been added to CMake version
3.25.

See https: //cmake.org/cmake/help/latest/command/block.html

Change-Id: If6458b84c3e30c4d4d8cbd3d3f1c661e8ffa869c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2023-05-25 12:46:32 +02:00
parent fe9e5cc42f
commit 42fff6e27e
2 changed files with 5 additions and 3 deletions

View File

@@ -89,7 +89,7 @@ QString CMakeAutoCompleter::insertMatchingQuote(const QTextCursor &cursor,
int CMakeAutoCompleter::paragraphSeparatorAboutToBeInserted(QTextCursor &cursor)
{
const QString line = cursor.block().text().trimmed();
if (line.contains(QRegularExpression(QStringLiteral("^(endfunction|endmacro|endif|endforeach|endwhile)\\w*\\("))))
if (line.contains(QRegularExpression(QStringLiteral("^(endfunction|endmacro|endif|endforeach|endwhile|endblock)\\w*\\("))))
tabSettings().indentLine(cursor.block(), tabSettings().indentationColumn(cursor.block().text()));
return 0;
}