DescriptionMacViews: Merge single-character edits, map (and validate) undo and redo
Undo and redo are mapped in a similar way to cut/copy/paste on Mac, via
the mainMenu's performKeyEquivalent, and the Cocoa responder chain.
This CL adds responders for undo: and redo:
Single-character editing commands were not being merged into a single
edit. For example, typing {'c', 'a', 't', Cmd+Z} would only undo the 't'
not the entire 'cat'. This CL fixes by detecting single-character
inserts in response to a keyDown event.
Then, for "redo", some of the textfield unittests would send both Ctrl+Y
and Ctrl+Shift+Z. Cmd+Y for undo isn't supported on Mac (it's mapped to
History -> Show Full History). So a wrapper is added that just sends
Cmd+Shfit+Z again.
Gets the following tests passing:
TextfieldTest.DragAndDrop_ToTheLeft
TextfieldTest.DragAndDrop_ToTheRight
TextfieldTest.UndoRedoTest
BUG=454353
Committed: https://crrev.com/3d9bea97122781eb552b491ec69065802263dd40
Cr-Commit-Position: refs/heads/master@{#316992}
Patch Set 1 #Patch Set 2 : Remove NSLog, as handy as that is.. #Patch Set 3 : rebase for r316774 (remove "ing" from "Editing") #
Total comments: 4
Patch Set 4 : prefer Ctrl+Shift+Z #
Total comments: 4
Patch Set 5 : no boolses #Patch Set 6 : selfnit unnecessary newlines #Patch Set 7 : ugh. left the MAYBE_ on #
Messages
Total messages: 14 (5 generated)
|