diff --git a/NEWS.md b/NEWS.md index 860422f0..927ff3ee 100644 --- a/NEWS.md +++ b/NEWS.md @@ -62,6 +62,12 @@ Red Panda C++ Version 2.27 - change: Invert scroll direction in horizontal, like in vertical. - enhancement: Show type completion info after 'const' and 'volatile' - fix: Caret unseen when move to a long line end by press END. + - fix: No icons for inherited class private members. + - fix: Ctrl+Return insert linebreak shouldn't scroll unnecessarilly. + - enhancement: Move caret to line begin would scroll to the begin if possible. + - fix: Filename in tables in the debug panel are not correctly eroded. + - enhancement: Tooltip info for the stacktrace table in the debug panel. + - fix: '*=' is treadted as '*' when parsing. - fix: Can't correctly retrieve function parameters type. Red Panda C++ Version 2.26 diff --git a/RedPandaIDE/debugger/debugger.cpp b/RedPandaIDE/debugger/debugger.cpp index 5e37a556..b0c1f200 100644 --- a/RedPandaIDE/debugger/debugger.cpp +++ b/RedPandaIDE/debugger/debugger.cpp @@ -1465,6 +1465,7 @@ QVariant BacktraceModel::data(const QModelIndex &index, int role) const return QVariant(); switch (role) { case Qt::DisplayRole: + case Qt::ToolTipRole: switch (index.column()) { case 0: return trace->funcname; diff --git a/RedPandaIDE/iconsmanager.cpp b/RedPandaIDE/iconsmanager.cpp index 9a0f3728..acadbb5a 100644 --- a/RedPandaIDE/iconsmanager.cpp +++ b/RedPandaIDE/iconsmanager.cpp @@ -308,6 +308,8 @@ QPixmap IconsManager::getPixmapForStatement(PStatement statement) return *(pIconsManager->getPixmap(IconsManager::PARSER_INHERITED_PROTECTED_METHOD)); } else if (statement->accessibility == StatementAccessibility::Public) { return *(pIconsManager->getPixmap(IconsManager::PARSER_INHERITED_METHOD)); + } else { + return *(pIconsManager->getPixmap(IconsManager::PARSER_PRIVATE_METHOD)); } } else { if (statement->accessibility == StatementAccessibility::Protected) { @@ -329,6 +331,8 @@ QPixmap IconsManager::getPixmapForStatement(PStatement statement) return *(pIconsManager->getPixmap(IconsManager::PARSER_INHERITED_PROTECTD_VAR)); } else if (statement->accessibility == StatementAccessibility::Public) { return *(pIconsManager->getPixmap(IconsManager::PARSER_INHERITED_VAR)); + } else { + return *(pIconsManager->getPixmap(IconsManager::PARSER_PRIVATE_VAR)); } } else { if (statement->accessibility == StatementAccessibility::Protected) { diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 86e9830f..28a69b46 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -205,10 +205,14 @@ MainWindow::MainWindow(QWidget *parent) m=ui->tblBreakpoints->selectionModel(); ui->tblBreakpoints->setModel(mDebugger->breakpointModel().get()); delete m; + ui->tblBreakpoints->setTextElideMode(Qt::ElideRight); + ui->tblBreakpoints->setWordWrap(false); m=ui->tblStackTrace->selectionModel(); ui->tblStackTrace->setModel(mDebugger->backtraceModel().get()); delete m; + ui->tblStackTrace->setTextElideMode(Qt::ElideRight); + ui->tblStackTrace->setWordWrap(false); m=ui->watchView->selectionModel(); ui->watchView->setModel(mDebugger->watchModel().get()); diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index 09b37b66..df79da2c 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -1328,7 +1328,7 @@ void CppParser::addProjectFile(const QString &fileName, bool needScan) //value.replace('/','\\'); // only accept full file names // Update project listing - mProjectFiles.insert(fileName); + mProjectFiles.insert(fileName); // Only parse given file if (needScan && !mPreprocessor.fileScanned(fileName)) { @@ -1342,7 +1342,7 @@ PStatement CppParser::addInheritedStatement(const PStatement& derived, const PSt PStatement statement = addStatement( derived, inherit->fileName, - inherit->type, // "Type" is already in use + inherit->type, inherit->command, inherit->args, inherit->noNameArgs, @@ -2249,8 +2249,8 @@ void CppParser::checkAndHandleMethodOrVar(KeywordType keywordType) // function call, skip it mIndex=moveToEndOfStatement(mIndex,true); } - } else if (mTokenizer[mIndex]->text.startsWith('*') - || mTokenizer[mIndex]->text.startsWith('&') + } else if (mTokenizer[mIndex]->text == "*" + || mTokenizer[mIndex]->text == "&" || mTokenizer[mIndex]->text=="::" || tokenIsIdentifier(mTokenizer[mIndex]->text) ) { @@ -3930,8 +3930,8 @@ void CppParser::handleStructs(bool isTypedef) int pos = mTokenizer[i]->text.indexOf('['); command += mTokenizer[i]->text.mid(0,pos) + ' '; args = mTokenizer[i]->text.mid(pos); - } else if (mTokenizer[i]->text.front() == '*' - || mTokenizer[i]->text.front() == '&') { // do not add spaces after pointer operator + } else if (mTokenizer[i]->text == "*" + || mTokenizer[i]->text == "&") { // do not add spaces after pointer operator command += mTokenizer[i]->text; } else { command += mTokenizer[i]->text + ' '; @@ -4575,8 +4575,8 @@ void CppParser::internalParse(const QString &fileName) handleInheritances(); // qDebug()<<"parse"<cbFont->setFontFilters(QFontComboBox::FontFilter::AllFonts); } + ui->cbFont->view()->reset(); } diff --git a/RedPandaIDE/settingsdialog/editorfontwidget.cpp b/RedPandaIDE/settingsdialog/editorfontwidget.cpp index 76eb8e8d..082fdaef 100644 --- a/RedPandaIDE/settingsdialog/editorfontwidget.cpp +++ b/RedPandaIDE/settingsdialog/editorfontwidget.cpp @@ -65,6 +65,7 @@ void EditorFontWidget::on_chkGutterOnlyMonospacedFonts_stateChanged(int) } else { ui->cbGutterFont->setFontFilters(QFontComboBox::FontFilter::AllFonts); } + ui->cbGutterFont->view()->reset(); } void EditorFontWidget::on_btnAddFont_clicked() diff --git a/RedPandaIDE/settingsdialog/executorproblemsetwidget.cpp b/RedPandaIDE/settingsdialog/executorproblemsetwidget.cpp index 02d9b2f4..0a445026 100644 --- a/RedPandaIDE/settingsdialog/executorproblemsetwidget.cpp +++ b/RedPandaIDE/settingsdialog/executorproblemsetwidget.cpp @@ -82,4 +82,5 @@ void ExecutorProblemSetWidget::on_chkOnlyMonospaced_stateChanged(int ) } else { ui->cbFont->setFontFilters(QFontComboBox::FontFilter::AllFonts); } + ui->cbFont->view()->reset(); } diff --git a/RedPandaIDE/widgets/editorfontdialog.cpp b/RedPandaIDE/widgets/editorfontdialog.cpp index 5563ae07..431ef326 100644 --- a/RedPandaIDE/widgets/editorfontdialog.cpp +++ b/RedPandaIDE/widgets/editorfontdialog.cpp @@ -1,5 +1,6 @@ #include "editorfontdialog.h" #include "ui_editorfontdialog.h" +#include EditorFontDialog::EditorFontDialog(QWidget *parent) : QDialog(parent) @@ -28,6 +29,7 @@ void EditorFontDialog::on_chkMonoOnly_toggled(bool checked) { QString savedFont = ui->fontComboBox->currentFont().family(); ui->fontComboBox->setFontFilters(checked ? QFontComboBox::MonospacedFonts : QFontComboBox::AllFonts); + ui->fontComboBox->view()->reset(); ui->fontComboBox->setCurrentFont(QFont(savedFont)); } diff --git a/libs/qsynedit/qsynedit/qsynedit.cpp b/libs/qsynedit/qsynedit/qsynedit.cpp index 73d57544..629ecfaf 100644 --- a/libs/qsynedit/qsynedit/qsynedit.cpp +++ b/libs/qsynedit/qsynedit/qsynedit.cpp @@ -3061,9 +3061,14 @@ void QSynEdit::ensureCursorPosVisibleEx(bool ForceToMiddle) }); // Make sure X is visible int visibleX = displayX(); - if (visibleX < leftPos()) - setLeftPos(visibleX); - else if (visibleX > viewWidth() + leftPos() && viewWidth()>0) + if (visibleX < leftPos()) { + if (viewWidth() / 3 >visibleX) + setLeftPos(0); + else if (viewWidth() > tabWidth() + mCharWidth) + setLeftPos(std::max(0,visibleX - tabWidth())); + else + setLeftPos(visibleX); + } else if (visibleX > viewWidth() + leftPos() && viewWidth()>0) if (viewWidth() >= 3*mCharWidth ) setLeftPos(visibleX - viewWidth() + 3*mCharWidth); else @@ -3100,9 +3105,9 @@ void QSynEdit::setInternalDisplayXY(const DisplayCoord &aPos) decPaintLock(); } -void QSynEdit::internalSetCaretXY(const BufferCoord &Value) +void QSynEdit::internalSetCaretXY(const BufferCoord &Value, bool ensureCaretVisible) { - setCaretXYEx(true, Value); + setCaretXYEx(ensureCaretVisible, Value); } void QSynEdit::internalSetCaretX(int Value) @@ -4871,7 +4876,7 @@ void QSynEdit::moveCaretVert(int deltaY, bool isSelection) mLastCaretColumn = SaveLastCaretX; } -void QSynEdit::moveCaretAndSelection(const BufferCoord &ptBefore, const BufferCoord &ptAfter, bool isSelection) +void QSynEdit::moveCaretAndSelection(const BufferCoord &ptBefore, const BufferCoord &ptAfter, bool isSelection, bool ensureCaretVisible) { if (mOptions.testFlag(EditorOption::eoGroupUndo)) { mUndoList->addGroupBreak(); @@ -4884,7 +4889,7 @@ void QSynEdit::moveCaretAndSelection(const BufferCoord &ptBefore, const BufferCo setBlockEnd(ptAfter); } else setBlockBegin(ptAfter); - internalSetCaretXY(ptAfter); + internalSetCaretXY(ptAfter,ensureCaretVisible); decPaintLock(); } @@ -4912,7 +4917,7 @@ void QSynEdit::moveCaretToLineStart(bool isSelection) moveCaretAndSelection(caretXY(), BufferCoord{newX, mCaretY}, isSelection); } -void QSynEdit::moveCaretToLineEnd(bool isSelection) +void QSynEdit::moveCaretToLineEnd(bool isSelection, bool ensureCaretVisible) { int vNewX; if (mOptions.testFlag(EditorOption::eoEnhanceEndKey)) { @@ -4930,7 +4935,7 @@ void QSynEdit::moveCaretToLineEnd(bool isSelection) } else vNewX = displayLineText().length() + 1; - moveCaretAndSelection(caretXY(), BufferCoord{vNewX, mCaretY}, isSelection); + moveCaretAndSelection(caretXY(), BufferCoord{vNewX, mCaretY}, isSelection, ensureCaretVisible); } void QSynEdit::doGotoBlockStart(bool isSelection) @@ -5763,9 +5768,10 @@ void QSynEdit::executeCommand(EditCommand command, QChar ch, void *pData) break; case EditCommand::LineBreakAtEnd: beginEditing(); + addLeftTopToUndo(); addCaretToUndo(); addSelectionToUndo(); - moveCaretToLineEnd(false); + moveCaretToLineEnd(false, false); insertLine(true); endEditing(); break; diff --git a/libs/qsynedit/qsynedit/qsynedit.h b/libs/qsynedit/qsynedit/qsynedit.h index 44c6a1ab..204c3c90 100644 --- a/libs/qsynedit/qsynedit/qsynedit.h +++ b/libs/qsynedit/qsynedit/qsynedit.h @@ -529,7 +529,7 @@ private: void ensureCursorPosVisibleEx(bool ForceToMiddle); void scrollWindow(int dx,int dy); void setInternalDisplayXY(const DisplayCoord& aPos); - void internalSetCaretXY(const BufferCoord& Value); + void internalSetCaretXY(const BufferCoord& Value, bool ensureCaretVisible = true); void internalSetCaretX(int Value); void internalSetCaretY(int Value); void setStatusChanged(StatusChanges changes); @@ -574,9 +574,9 @@ private: void moveCaretHorz(int deltaX, bool isSelection); void moveCaretVert(int deltaY, bool isSelection); void moveCaretAndSelection(const BufferCoord& ptBefore, const BufferCoord& ptAfter, - bool isSelection); + bool isSelection, bool ensureCaretVisible = true); void moveCaretToLineStart(bool isSelection); - void moveCaretToLineEnd(bool isSelection); + void moveCaretToLineEnd(bool isSelection, bool ensureCaretVisible = true); void doGotoBlockStart(bool isSelection); void doGotoBlockEnd(bool isSelection); void doGotoEditorStart(bool isSelection);