aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa
diff options
context:
space:
mode:
authornyamatongwe <nyamatongwe@gmail.com>2013-04-17 12:56:44 +1000
committernyamatongwe <nyamatongwe@gmail.com>2013-04-17 12:56:44 +1000
commit6e7d78f6421100f2ed96b262d5fde3b7f84045df (patch)
treef1a3fc75e8ae56d47abb07b6defcbbbc85c46ea3 /cocoa
parentc4279c0a62777aceac64fd37d366e257f13d3528 (diff)
downloadscintilla-mirror-6e7d78f6421100f2ed96b262d5fde3b7f84045df.tar.gz
Restore undo collection after sequence of composition actions by only remembering
undo collection state when switching to composition, not when composition changed.
Diffstat (limited to 'cocoa')
-rw-r--r--cocoa/ScintillaView.mm10
1 files changed, 6 insertions, 4 deletions
diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm
index 4fa6dcb54..0b8fddf56 100644
--- a/cocoa/ScintillaView.mm
+++ b/cocoa/ScintillaView.mm
@@ -403,14 +403,16 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor)
}
else
{
+ // Switching into composition so remember if collecting undo.
+ undoCollectionWasActive = [mOwner getGeneralProperty: SCI_GETUNDOCOLLECTION] != 0;
+
+ // Keep Scintilla from collecting undo actions for the composition task.
+ [mOwner setGeneralProperty: SCI_SETUNDOCOLLECTION value: 0];
+
// Ensure only a single selection
mOwner.backend->SelectOnlyMainSelection();
}
- // Keep Scintilla from collecting undo actions for the composition task.
- undoCollectionWasActive = [mOwner getGeneralProperty: SCI_GETUNDOCOLLECTION] != 0;
- [mOwner setGeneralProperty: SCI_SETUNDOCOLLECTION value: 0];
-
// Note: Scintilla internally works almost always with bytes instead chars, so we need to take
// this into account when determining selection ranges and such.
std::string raw_text = [newText UTF8String];