- fix: undo "delete word"/"delete to BOL"/"delete to EOL" correct reset caret position
This commit is contained in:
parent
9c2ffa2f80
commit
614fc911b1
1
NEWS.md
1
NEWS.md
|
@ -4,6 +4,7 @@ Version 0.9.3 For Dev-C++ 7 Beta
|
|||
- fix: restore caret position after reformat code
|
||||
- enhancement: ask user to rebuild project, when run/debug the project and it has been modified
|
||||
- fix: correct set the enabled state of "delete line"/"insert line"/"delete word"/"delete to BOL"/"delete to EOL" menu items
|
||||
- fix: undo "delete word"/"delete to BOL"/"delete to EOL" correct reset caret position
|
||||
|
||||
Version 0.9.2 For Dev-C++ 7 Beta
|
||||
- fix: gutter of the disassembly code control in the cpu info dialog is grayed
|
||||
|
|
|
@ -5246,13 +5246,18 @@ void SynEdit::deleteFromTo(const BufferCoord &start, const BufferCoord &end)
|
|||
return;
|
||||
doOnPaintTransient(SynTransientType::ttBefore);
|
||||
if ((start.Char != end.Char) || (start.Line != end.Line)) {
|
||||
BufferCoord oldCaret = caretXY();
|
||||
setBlockBegin(start);
|
||||
setBlockEnd(end);
|
||||
setActiveSelectionMode(SynSelectionMode::smNormal);
|
||||
QString helper = selText();
|
||||
setSelTextPrimitive("");
|
||||
mUndoList->BeginBlock();
|
||||
mUndoList->AddChange(SynChangeReason::crCaret, oldCaret, start,
|
||||
"", SynSelectionMode::smNormal);
|
||||
mUndoList->AddChange(SynChangeReason::crSilentDeleteAfterCursor, start, end,
|
||||
helper, SynSelectionMode::smNormal);
|
||||
mUndoList->EndBlock();
|
||||
internalSetCaretXY(start);
|
||||
}
|
||||
doOnPaintTransient(SynTransientType::ttAfter);
|
||||
|
|
Loading…
Reference in New Issue