From 469c5f21d31213bb503db294553bc4c0156d8a65 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Tue, 15 Mar 2022 13:44:18 +0800 Subject: [PATCH] - fix: error when insert text in column mode --- NEWS.md | 1 + RedPandaIDE/qsynedit/SynEdit.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 4703a440..4ce700e9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -20,6 +20,7 @@ Red Panda C++ Version 1.0.0 - fix: redo cut with no selection while make whole line selected - fix: correctly reset caret when redo cut with no selection - enhancement: close editor when middle button clicked on it's title tab + - fix: error when insert text in column mode Red Panda C++ Version 0.14.5 - fix: the "gnu c++ 20" option in compiler set options is wrong diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index a7cb13bc..0d88c8bb 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -2836,13 +2836,13 @@ void SynEdit::doCutToClipboard() } internalDoCopyToClipboard(selText()); doSetSelText(""); + mUndoList->EndBlock(); mUndoList->AddChange( SynChangeReason::crNothing, BufferCoord{0,0}, BufferCoord{0,0}, "", SynSelectionMode::smNormal); - mUndoList->EndBlock(); } void SynEdit::doCopyToClipboard() @@ -5340,7 +5340,7 @@ int SynEdit::insertTextByColumnMode(const QString &Value, bool AddToUndoList) do { P = GetEOL(Value,Start); if (P != Start) { - Str = Value.mid(0,P-Start); + Str = Value.mid(Start,P-Start); // Move(Start^, Str[1], P - Start); if (mCaretY > mLines->count()) { Result++;