From 0bedb63fa22a19ba0a48d593b4eed8e814a7ba1e Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Wed, 15 Feb 2023 20:49:42 +0800 Subject: [PATCH] - fix: Wrong selection position after delete in column mode. --- NEWS.md | 1 + libs/qsynedit/qsynedit/qsynedit.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/NEWS.md b/NEWS.md index fa138df5..3330170f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -25,6 +25,7 @@ Red Panda C++ Version 2.12 - fix: Can't correctly create project, if template's encoding setting is not valid. - enhancement: New "embed assembly" template. - enhancement: New "Hello GAS" and "GAS and C" templates for linux and win64. + - fix: Wrong selection position after delete in column mode. Red Panda C++ Version 2.11 diff --git a/libs/qsynedit/qsynedit/qsynedit.cpp b/libs/qsynedit/qsynedit/qsynedit.cpp index 306d139d..533cf0a0 100644 --- a/libs/qsynedit/qsynedit/qsynedit.cpp +++ b/libs/qsynedit/qsynedit/qsynedit.cpp @@ -5355,7 +5355,11 @@ void QSynEdit::doDeleteText(BufferCoord startPos, BufferCoord endPos, SelectionM properSetLine(i,s); } // Lines never get deleted completely, so keep caret at end. + startPos.ch = columnToChar(startPos.line,ColFrom); + endPos.ch = columnToChar(endPos.line, ColFrom); internalSetCaretXY(startPos); + setBlockBegin(startPos); + setBlockEnd(endPos); // Column deletion never removes a line entirely, so no mark // updating is needed here. break;