mirror of
https://github.com/mirror/scintilla.git
synced 2025-10-14 02:43:26 +08:00
Use UndoGroup to ensure action ended if exception occurs.
This commit is contained in:
@@ -1102,11 +1102,12 @@ void ScintillaCocoa::Paste(bool forceRectangular) {
|
||||
// No data or no flavor we support.
|
||||
return;
|
||||
|
||||
pdoc->BeginUndoAction();
|
||||
ClearSelection(false);
|
||||
InsertPasteShape(selectedText.Data(), selectedText.Length(),
|
||||
selectedText.rectangular ? PasteShape::rectangular : PasteShape::stream);
|
||||
pdoc->EndUndoAction();
|
||||
{
|
||||
UndoGroup ug(pdoc);
|
||||
ClearSelection(false);
|
||||
InsertPasteShape(selectedText.Data(), selectedText.Length(),
|
||||
selectedText.rectangular ? PasteShape::rectangular : PasteShape::stream);
|
||||
}
|
||||
|
||||
Redraw();
|
||||
EnsureCaretVisible();
|
||||
|
@@ -1167,10 +1167,9 @@ void ScintillaWin::SelectionToHangul() {
|
||||
|
||||
if (converted) {
|
||||
documentStr = StringEncode(uniStr, CodePageOfDocument());
|
||||
pdoc->BeginUndoAction();
|
||||
UndoGroup ug(pdoc);
|
||||
ClearSelection();
|
||||
InsertPaste(&documentStr[0], documentStr.size());
|
||||
pdoc->EndUndoAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user