- fix: Can't copy by ctrl+dray&drop to current selection's begin/end

This commit is contained in:
Roy Qu 2023-06-26 09:00:08 +08:00
parent adcaba29d0
commit b85b70bb4b
2 changed files with 8 additions and 1 deletions

View File

@ -11,6 +11,7 @@ Red Panda C++ Version 2.23
- enhancement: improve pointer calculation when inferencing type info
- enhancement: improve parsing for multiple vars defined in one line
- enhancement: improve parsing result for function parameters like 'Node (&node)[10]'
- fix: Can't copy by ctrl+dray&drop to current selection's begin/end
Red Panda C++ Version 2.22

View File

@ -6386,7 +6386,13 @@ void QSynEdit::dropEvent(QDropEvent *event)
BufferCoord coord = displayToBufferPos(pixelsToNearestRowColumn(event->pos().x(),
event->pos().y()));
if (coord>=mDragSelBeginSave && coord<=mDragSelEndSave) {
if (
(event->proposedAction() == Qt::DropAction::CopyAction
&& coord>mDragSelBeginSave && coord<mDragSelEndSave)
||
(event->proposedAction() != Qt::DropAction::CopyAction
&& coord>=mDragSelBeginSave && coord<=mDragSelEndSave)
) {
mDocument->deleteAt(mDocument->count()-1);
//do nothing if drag onto itself
event->acceptProposedAction();