From c4b61b8985f944be8c68233483006f0ced6a3d82 Mon Sep 17 00:00:00 2001 From: royqh1979 Date: Sat, 13 Nov 2021 17:15:07 +0800 Subject: [PATCH] - fix: option "don't add leading zeros to line numbers" not work --- NEWS.md | 1 + RedPandaIDE/cpprefacter.cpp | 2 +- RedPandaIDE/qsynedit/MiscClasses.cpp | 11 +++++++---- RedPandaIDE/qsynedit/SynEdit.cpp | 4 ++-- RedPandaIDE/widgets/darkfusionstyle.cpp | 4 ++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/NEWS.md b/NEWS.md index 681e8ba1..ccb464bb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,6 +8,7 @@ Version 0.8.7 For Dev-C++ 7 Beta - enhancement: shift+mouse wheel to scroll horizontally - fix: greatly reduces paste time - fix: auto indent shouldn't use preprocessor's indent to calculate + - fix: option "don't add leading zeros to line numbers" not work Version 0.8.6 For Dev-C++ 7 Beta - enhancement: greatly reduces memory usage for symbol parsing ( memory needed for bits/stdc++.h reduced from 150m+ to 80m+) diff --git a/RedPandaIDE/cpprefacter.cpp b/RedPandaIDE/cpprefacter.cpp index 37eb56e9..1fcb5958 100644 --- a/RedPandaIDE/cpprefacter.cpp +++ b/RedPandaIDE/cpprefacter.cpp @@ -48,7 +48,7 @@ bool CppRefacter::findOccurence(Editor *editor, const BufferCoord &pos) bool CppRefacter::findOccurence(const QString &statementFullname, SearchFileScope scope) { PCppParser parser; - Editor * editor; + Editor * editor=nullptr; std::shared_ptr project; if (scope == SearchFileScope::currentFile) { editor = pMainWindow->editorList()->getEditor(); diff --git a/RedPandaIDE/qsynedit/MiscClasses.cpp b/RedPandaIDE/qsynedit/MiscClasses.cpp index 823edcd7..01e60b5c 100644 --- a/RedPandaIDE/qsynedit/MiscClasses.cpp +++ b/RedPandaIDE/qsynedit/MiscClasses.cpp @@ -95,7 +95,11 @@ QString SynGutter::formatLineNumber(int line) { line += (mLineNumberStart - 1); QString result = QString::number(line); - return QString(mAutoSizeDigitCount - result.length(),'0') + result; + if (mLeadingZeros) { + return QString(mAutoSizeDigitCount - result.length(),'0') + result; + } else { + return result; + } } int SynGutter::realGutterWidth(int charWidth) @@ -315,10 +319,9 @@ void SynGutter::setBorderColor(const QColor &value) } -SynEditMark::SynEditMark(QObject *parent) +SynEditMark::SynEditMark(QObject * /*parent*/) { mBookmarkNum = -1; - } int SynEditMark::Char() const @@ -405,7 +408,7 @@ void SynEditMark::setLine(int line) } } -SynBookMarkOpt::SynBookMarkOpt(QObject *parent) +SynBookMarkOpt::SynBookMarkOpt(QObject */*parent*/) { mDrawBookmarksFirst = true; mEnableKeys = true; diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index d0f88af2..6b4caa5c 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -5991,7 +5991,7 @@ void SynEdit::mouseMoveEvent(QMouseEvent *event) mimeData->setText(selText()); drag->setMimeData(mimeData); - Qt::DropAction dropAction = drag->exec(Qt::CopyAction | Qt::MoveAction); + drag->exec(Qt::CopyAction | Qt::MoveAction); //drag->setPixmap(iconPixmap); //BeginDrag(false); } @@ -6146,7 +6146,7 @@ void SynEdit::dragMoveEvent(QDragMoveEvent *event) showCaret(); } -void SynEdit::dragLeaveEvent(QDragLeaveEvent *event) +void SynEdit::dragLeaveEvent(QDragLeaveEvent *) { setCaretXY(mDragCaretSave); setBlockBegin(mDragSelBeginSave); diff --git a/RedPandaIDE/widgets/darkfusionstyle.cpp b/RedPandaIDE/widgets/darkfusionstyle.cpp index ac5560fc..b5cc66c9 100644 --- a/RedPandaIDE/widgets/darkfusionstyle.cpp +++ b/RedPandaIDE/widgets/darkfusionstyle.cpp @@ -807,8 +807,8 @@ void DarkFusionStyle::drawControl(ControlElement element, const QStyleOption *op case CE_MenuItem: // Draws one item in a popup menu. if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast(option)) { - QColor highlightOutline = highlightedOutline; - QColor highlight = option->palette.highlight().color(); + //QColor highlightOutline = highlightedOutline; + //QColor highlight = option->palette.highlight().color(); if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) { painter->save(); int w = 0;