diff --git a/libs/qsynedit/qsynedit/qsynedit.cpp b/libs/qsynedit/qsynedit/qsynedit.cpp index a1a48be2..6972db71 100644 --- a/libs/qsynedit/qsynedit/qsynedit.cpp +++ b/libs/qsynedit/qsynedit/qsynedit.cpp @@ -6302,6 +6302,14 @@ void QSynEdit::dropEvent(QDropEvent *event) && coord>=mDragSelBeginSave && coord<=mDragSelEndSave) ) { mDocument->deleteAt(mDocument->count()-1); + int topPos = mTopPos; + if (topPos!=mMouseScrollOldTop) { + int offset = topPos % mTextHeight; + if (offset!=0) + topPos -= offset; + setTopPos(topPos); + ensureCaretVisible(); + } //do nothing if drag onto itself event->acceptProposedAction(); mDropped = true;