- fix: astyle.exe can't correctly format files that using non-ascii identifier

This commit is contained in:
Roy Qu 2022-09-26 16:17:02 +08:00
parent 70bf0c9eb7
commit a165efa7cf
3 changed files with 6 additions and 2 deletions

View File

@ -5,6 +5,7 @@ Red Panda C++ Version 1.4
- fix: can't open text project file in the editor
- change: when create non-text project file, don't auto open it
- fix: the project compiler options is not correctly read when open old dev-c++ project
- fix: astyle.exe can't correctly format files that using non-ascii identifier
Red Panda C++ Version 1.3

View File

@ -4291,6 +4291,7 @@ void Editor::reformat()
onLinesDeleted(1,document()->count());
QByteArray content = text().toUtf8();
QStringList args = pSettings->codeFormatter().getArguments();
qDebug()<<args;
#ifdef Q_OS_WIN
QByteArray newContent = runAndGetOutput("astyle.exe",
pSettings->dirs().appDir(),

View File

@ -714,8 +714,10 @@ bool ASBase::isLegalNameChar(char ch) const
{
if (isWhiteSpace(ch))
return false;
if ((unsigned char) ch > 127)
return false;
// if ((unsigned char) ch > 127)
// return false;
if ((unsigned char) ch > 127)
return true;
return (isalnum((unsigned char) ch)
|| ch == '.' || ch == '_'
|| (isJavaStyle() && ch == '$')