From 75cb4c9b5a3fb94972d4223126b83227614a8315 Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Fri, 29 Oct 2021 19:20:55 +0800 Subject: [PATCH] - fix: correctly updates cursor position when pasting from clipboard --- RedPandaIDE/qsynedit/SynEdit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index 8c77c475..6fc46318 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -3476,6 +3476,7 @@ void SynEdit::onSizeOrFontChanged(bool bFont) if (mCharWidth != 0) { mCharsInWindow = std::max(clientWidth() - mGutterWidth - 2, 0) / mCharWidth; mLinesInWindow = clientHeight() / mTextHeight; + bool scrollBarChangedSettings = mStateFlags.testFlag(SynStateFlag::sfScrollbarChanged); if (bFont) { if (mGutter.showLineNumbers()) onGutterChanged(); @@ -3485,7 +3486,7 @@ void SynEdit::onSizeOrFontChanged(bool bFont) invalidate(); } else updateScrollbars(); - mStateFlags.setFlag(SynStateFlag::sfScrollbarChanged,false); + mStateFlags.setFlag(SynStateFlag::sfScrollbarChanged,scrollBarChangedSettings); //if (!mOptions.testFlag(SynEditorOption::eoScrollPastEol)) setLeftChar(mLeftChar); //if (!mOptions.testFlag(SynEditorOption::eoScrollPastEof))