From 78c3387d7f838afd48562324c1d46f5781f08121 Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Mon, 8 Nov 2021 22:00:49 +0800 Subject: [PATCH] - fix: correctly display watch & local variable names when debugging --- NEWS.md | 5 +++-- RedPandaIDE/debugger.cpp | 6 +++--- RedPandaIDE/mainwindow.cpp | 1 + RedPandaIDE/settings.cpp | 16 +++++++++++++++- RedPandaIDE/systemconsts.h | 2 +- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/NEWS.md b/NEWS.md index 799d43e1..3db45503 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,8 +2,9 @@ Version 0.8.2 For Dev-C++ 7 Beta - fix: highlighter can't correctly find the end of ANSI C-style Comments - enhancement: add default color scheme to themes. Change theme option will change color scheme too. - fix: when changing options in the option dialog's color scheme panle, color of the demo editor won't be not correctly updated - - enhancement: add option to auto clear parsed symbols when the editor is hidden ( to reduce total memory usage / turned off by default) - - fix: correct set the position of chinese input methods + - enhancement: auto clear parsed symbols when the editor is hidden ( to reduce memory usage of un-active editors) + - fix: when inputing in the editor, correctly set the position of the input method panel + - fix: correctly display watch & local variable names when debugging Version 0.8.1 For Dev-C++ 7 Beta - fix: ConsolePaurser.exe only exits when press ENTER diff --git a/RedPandaIDE/debugger.cpp b/RedPandaIDE/debugger.cpp index 3c69e96b..0fca8bd3 100644 --- a/RedPandaIDE/debugger.cpp +++ b/RedPandaIDE/debugger.cpp @@ -1450,9 +1450,9 @@ void DebugReader::runNextCmd() emit cmdStarted(); QByteArray s; - s=pCmd->command.toLocal8Bit(); + s=pCmd->command.toUtf8(); if (!pCmd->params.isEmpty()) { - s+=' '+pCmd->params.toLocal8Bit(); + s+=' '+pCmd->params.toUtf8(); } s+= "\n"; if (mProcess->write(s)<0) { @@ -1681,7 +1681,7 @@ void DebugReader::run() readed = mProcess->readAll(); buffer += readed; if (getLastAnnotation(buffer) == AnnotationType::TPrompt) { - mOutput = QString::fromLocal8Bit(buffer); + mOutput = QString::fromUtf8(buffer); processDebugOutput(); buffer.clear(); mCmdRunning = false; diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index e602df08..57f4726d 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -1279,6 +1279,7 @@ void MainWindow::debug() if (!mDebugger->start()) return; filePath.replace('\\','/'); + mDebugger->sendCommand("set","host charset UTF-8"); mDebugger->sendCommand("file", '"' + filePath + '"'); if (mProject->options().type == ProjectType::DynamicLib) { diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 7b9cd538..2d3a7c5a 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -3262,7 +3262,21 @@ void Settings::CodeCompletion::doLoad() mIgnoreCase = boolValue("ignore_case",true); mAppendFunc = boolValue("append_func",true); mShowCodeIns = boolValue("show_code_ins",true); - mClearWhenEditorHidden = boolValue("clear_when_editor_hidden",false); + + bool doClear = true; + +#ifdef Q_OS_WIN + MEMORYSTATUSEX statex; + + statex.dwLength = sizeof (statex); + + GlobalMemoryStatusEx (&statex); + if (statex.ullAvailPhys > (long long int)3*1024*1024*1024) { + doClear = false; + } +#endif + + mClearWhenEditorHidden = boolValue("clear_when_editor_hidden",doClear); } Settings::CodeFormatter::CodeFormatter(Settings *settings): diff --git a/RedPandaIDE/systemconsts.h b/RedPandaIDE/systemconsts.h index 5490c26c..63a37f14 100644 --- a/RedPandaIDE/systemconsts.h +++ b/RedPandaIDE/systemconsts.h @@ -3,7 +3,7 @@ #include -#define DEVCPP_VERSION "beta.0.8.1" +#define DEVCPP_VERSION "beta.0.8.2" #define APP_SETTSINGS_FILENAME "redpandacpp.ini" #ifdef Q_OS_WIN