diff --git a/src/codesnippet.cpp b/src/codesnippet.cpp index c17b61b6d..163599e47 100644 --- a/src/codesnippet.cpp +++ b/src/codesnippet.cpp @@ -370,7 +370,7 @@ void CodeSnippet::insertAt(QEditor *editor, QDocumentCursor *cursor, Placeholder // on multi line commands, replace environments only if (autoReplaceCommands && byCompleter && lines.size() > 1 && line.contains("\\begin{")) { QString curLine = cursor->line().text(); - int wordBreak = curLine.indexOf(QRegularExpression("\\W"), cursor->columnNumber()); + int wordBreak = curLine.indexOf(QRegularExpression("\\W",QRegularExpression::UseUnicodePropertiesOption), cursor->columnNumber()); int closeCurl = curLine.indexOf("}", cursor->columnNumber()); int openCurl = curLine.indexOf("{", cursor->columnNumber()); int openBracket = curLine.indexOf("[", cursor->columnNumber()); @@ -441,7 +441,7 @@ void CodeSnippet::insertAt(QEditor *editor, QDocumentCursor *cursor, Placeholder if (byCompleter && autoReplaceCommands && lines.size() == 1 && (line.startsWith('\\') || isKeyVal) ) { if (cursor->nextChar().isLetterOrNumber() || cursor->nextChar() == QChar('{') || cursor->nextChar() == QChar('=')) { QString curLine = cursor->line().text(); - int wordBreak = curLine.indexOf(QRegularExpression("\\W"), cursor->columnNumber()); + int wordBreak = curLine.indexOf(QRegularExpression("\\W",QRegularExpression::UseUnicodePropertiesOption), cursor->columnNumber()); int wordBreakEqual = curLine.indexOf("=", cursor->columnNumber()); int closeCurl = curLine.indexOf("}", cursor->columnNumber()); int openCurl = curLine.indexOf("{", cursor->columnNumber());