diff --git a/NEWS.md b/NEWS.md index 0f4e4557..7f94435a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,8 @@ Red Panda C++ Version 0.14.5 - enhancement: option "open files in the same red panda C++ instance", in options->environment->file associations - enhancement: hide unsupported files in files view - fix: can't correctly set break conditions + - fix: crash when copy to non-c files + - fix: fonts in cpu window is not correctly set, when dpi changed Red Panda C++ Version 0.14.4 diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 63e260e6..d96d359e 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -625,6 +625,9 @@ void MainWindow::applySettings() for (QWidget* p:findChildren()) { p->setFont(font); } + if (mCPUDialog!=nullptr) { + mCPUDialog->resetEditorFont(); + } if (pSettings->environment().useCustomIconSet()) { QString customIconSetFolder = pSettings->dirs().config(Settings::Dirs::DataType::IconSet); pIconsManager->prepareCustomIconSet(customIconSetFolder); diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index b2546491..22540f55 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -5169,10 +5169,13 @@ int SynEdit::insertTextByNormalMode(const QString &Value) rescanRange(caretY); // step2: insert remaining lines of Value while (P < Value.length()) { - bool notInComment = !mHighlighter->isLastLineCommentNotFinished( + bool notInComment = true; + if (mHighlighter) { + notInComment = !mHighlighter->isLastLineCommentNotFinished( mHighlighter->getRangeState().state) && !mHighlighter->isLastLineStringNotFinished( mHighlighter->getRangeState().state); + } if (Value[P] == '\r') P++; if (Value[P] == '\n') diff --git a/RedPandaIDE/widgets/cpudialog.cpp b/RedPandaIDE/widgets/cpudialog.cpp index aa6775e4..46bd199f 100644 --- a/RedPandaIDE/widgets/cpudialog.cpp +++ b/RedPandaIDE/widgets/cpudialog.cpp @@ -54,6 +54,8 @@ CPUDialog::CPUDialog(QWidget *parent) : ui->txtCode->setForegroundColor(palette().color(QPalette::Text)); ui->txtCode->setBackgroundColor(palette().color(QPalette::Base)); } + + resetEditorFont(); ui->lstRegister->setModel(pMainWindow->debugger()->registerModel()); ui->rdIntel->setChecked(pSettings->debugger().useIntelStyle()); @@ -112,6 +114,18 @@ void CPUDialog::setDisassembly(const QString& file, const QString& funcName,cons ui->txtCode->setCaretXYEx(true,BufferCoord{1,activeLine+1}); } +void CPUDialog::resetEditorFont() +{ + QFont f=QFont(pSettings->editor().fontName()); + f.setPixelSize(pointToPixel(pSettings->editor().fontSize())); + f.setStyleStrategy(QFont::PreferAntialias); + ui->txtCode->setFont(f); + QFont f2=QFont(pSettings->editor().nonAsciiFontName()); + f2.setPixelSize(pointToPixel(pSettings->editor().fontSize())); + f2.setStyleStrategy(QFont::PreferAntialias); + ui->txtCode->setFontForNonAscii(f2); +} + void CPUDialog::sendSyntaxCommand() { // Set disassembly flavor diff --git a/RedPandaIDE/widgets/cpudialog.h b/RedPandaIDE/widgets/cpudialog.h index 3b3781de..e66c2502 100644 --- a/RedPandaIDE/widgets/cpudialog.h +++ b/RedPandaIDE/widgets/cpudialog.h @@ -34,6 +34,7 @@ public: void updateButtonStates(bool enable); public slots: void setDisassembly(const QString& file, const QString& funcName,const QStringList& lines); + void resetEditorFont(); signals: void closed(); private: