diff --git a/NEWS.md b/NEWS.md index 411449c8..634bfb64 100644 --- a/NEWS.md +++ b/NEWS.md @@ -71,6 +71,7 @@ Red Panda C++ Version 2.27 - fix: Can't correctly retrieve function parameters type. - fix: Auto type induction for expression contains '[]' are not correct. - fix: Option 'Pause after run in console' for tools doesn't work. + - fix: Filename that contains '&' doesn't correctly displayed in the editor tab. Red Panda C++ Version 2.26 - enhancement: Code suggestion for embedded std::vectors. diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index ee8b6a4a..72db5772 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -5467,17 +5467,18 @@ void Editor::updateCaption(const QString& newCaption) { int index = mParentPageControl->indexOf(this); if (index==-1) return; + QString caption; if (newCaption.isEmpty()) { - QString caption = QFileInfo(mFilename).fileName(); + caption = QFileInfo(mFilename).fileName(); if (this->modified()) { caption.append("[*]"); } if (this->readOnly()) { caption.append("["+tr("Readonly")+"]"); - } - mParentPageControl->setTabText(index,caption); + } } else { - mParentPageControl->setTabText(index,newCaption); + caption = newCaption; } - + caption = caption.replace("&","&&"); + mParentPageControl->setTabText(index,caption); }