Merge "Make Undo/Redo work properly with IME."