From a165efa7cf87a639b42ed9d0eba6aec9e2f506da Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Mon, 26 Sep 2022 16:17:02 +0800 Subject: [PATCH] - fix: astyle.exe can't correctly format files that using non-ascii identifier --- NEWS.md | 1 + RedPandaIDE/editor.cpp | 1 + tools/astyle/ASResource.cpp | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index a1eec31b..4671886f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index 3f993f80..0def8d35 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -4291,6 +4291,7 @@ void Editor::reformat() onLinesDeleted(1,document()->count()); QByteArray content = text().toUtf8(); QStringList args = pSettings->codeFormatter().getArguments(); + qDebug()<dirs().appDir(), diff --git a/tools/astyle/ASResource.cpp b/tools/astyle/ASResource.cpp index e16561ae..9c190cb0 100644 --- a/tools/astyle/ASResource.cpp +++ b/tools/astyle/ASResource.cpp @@ -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 == '$')