From ec9115e749714d63126ff25c3109b17a0b644695 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 7 Mar 2017 22:30:47 -0700 Subject: [PATCH] Skip un-accented character when undoing after using press-and-hold menu --- src/text-editor-component.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/text-editor-component.js b/src/text-editor-component.js index 271c3e74f..315647aa8 100644 --- a/src/text-editor-component.js +++ b/src/text-editor-component.js @@ -654,6 +654,12 @@ class TextEditorComponent { this.compositionCheckpoint = null } + // Undo insertion of the original non-accented character so it is discarded + // from the history and does not reappear on undo + if (this.accentedCharacterMenuIsOpen) { + this.getModel().undo() + } + this.getModel().insertText(event.data, {groupUndo: true}) }