From 0f3baaac0044821981bf5bb3c1728d3de56f2c66 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 23 Dec 2021 22:05:57 +0800 Subject: [PATCH] Version 0.12.1 For Dev-C++ 7 Beta - fix: error when drag&drop in editors --- NEWS.md | 3 +++ RedPandaIDE/project.cpp | 2 +- RedPandaIDE/qsynedit/SynEdit.cpp | 6 ++++-- RedPandaIDE/version.h | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 59e6c7b1..72a3c6e7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +Version 0.12.1 For Dev-C++ 7 Beta + - fix: error when drag&drop in editors + Version 0.12.0 For Dev-C++ 7 Beta - enhancement: enable run/debug/compile when console program finished but pausing. diff --git a/RedPandaIDE/project.cpp b/RedPandaIDE/project.cpp index 8e2fd4e4..2c7f5328 100644 --- a/RedPandaIDE/project.cpp +++ b/RedPandaIDE/project.cpp @@ -653,7 +653,7 @@ bool Project::assignTemplate(const std::shared_ptr aTemplate, b PTemplateUnit templateUnit = aTemplate->unit(i); QString s; PProjectUnit unit; - if (options().useGPP) { + if (mOptions.useGPP) { s = templateUnit->CppText; unit = newUnit(mNode, templateUnit->CppName); } else { diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index fc31e665..a8688df2 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -205,6 +205,8 @@ void SynEdit::setCaretY(int value) void SynEdit::setCaretXY(const BufferCoord &value) { + setBlockBegin(value); + setBlockEnd(value); setCaretXYEx(true,value); } @@ -6184,7 +6186,7 @@ void SynEdit::dragEnterEvent(QDragEnterEvent *event) mDragSelEndSave = blockEnd(); BufferCoord coord = displayToBufferPos(pixelsToNearestRowColumn(event->pos().x(), event->pos().y())); - setCaretXY(coord); + internalSetCaretXY(coord); setBlockBegin(mDragSelBeginSave); setBlockEnd(mDragSelEndSave); showCaret(); @@ -6221,7 +6223,6 @@ void SynEdit::dropEvent(QDropEvent *event) //paste to new position setTopLine(topLine); setLeftChar(leftChar); - setCaretXY(coord); setSelText(event->mimeData()->text()); //delete old setBlockBegin(mDragSelBeginSave); @@ -6246,6 +6247,7 @@ void SynEdit::dropEvent(QDropEvent *event) } mUndoList->EndBlock(); } + event->acceptProposedAction(); } diff --git a/RedPandaIDE/version.h b/RedPandaIDE/version.h index ca064557..7285b282 100644 --- a/RedPandaIDE/version.h +++ b/RedPandaIDE/version.h @@ -2,6 +2,6 @@ #define VERSION_H #include -#define DEVCPP_VERSION "beta.0.11.5" +#define DEVCPP_VERSION "beta.0.12.1" #endif // VERSION_H