Skip to content

Commit

Permalink
use UTF mode for regExp
Browse files Browse the repository at this point in the history
  • Loading branch information
sunderme committed Sep 26, 2024
1 parent d47afc7 commit 3679098
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/codesnippet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 3679098

Please sign in to comment.