diff options
author | DhabyX <slack.dhabyx@gmail.com> | 2017-02-26 09:40:08 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-02-26 10:05:30 +0700 |
commit | 04ddd3aa73efab669eb5972895872a72238b6012 (patch) | |
tree | dee1d6721b6f6051629aafcdb1aba6ad7e0fd73f /development/atom/fix-ime-events-handler-electron-1.4.patch | |
parent | 2969e9859604c541b34d7735abc4bc04d5839682 (diff) |
development/atom: Updated for version 1.14.3.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/atom/fix-ime-events-handler-electron-1.4.patch')
-rw-r--r-- | development/atom/fix-ime-events-handler-electron-1.4.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/development/atom/fix-ime-events-handler-electron-1.4.patch b/development/atom/fix-ime-events-handler-electron-1.4.patch new file mode 100644 index 0000000000000..db5681d4fd5ae --- /dev/null +++ b/development/atom/fix-ime-events-handler-electron-1.4.patch @@ -0,0 +1,47 @@ +--- a/src/text-editor-component.coffee ++++ b/src/text-editor-component.coffee +@@ -110,6 +110,7 @@ class TextEditorComponent + @updateSync() + @checkForVisibilityChange() + @initialized = true ++ @checkpointForIME = null + + destroy: -> + @mounted = false +@@ -305,19 +306,20 @@ class TextEditorComponent + # User escape to cancel + # 4. compositionend fired + # OR User chooses a completion +- # 4. compositionend fired +- # 5. textInput fired; event.data == the completion string ++ # 4. textInput fired; event.data == the completion string ++ # 5. compositionend fired + +- checkpoint = null + @domNode.addEventListener 'compositionstart', => + if @openedAccentedCharacterMenu + @editor.selectLeft() + @openedAccentedCharacterMenu = false +- checkpoint = @editor.createCheckpoint() ++ @checkpointForIME = @editor.createCheckpoint() + @domNode.addEventListener 'compositionupdate', (event) => + @editor.insertText(event.data, select: true) + @domNode.addEventListener 'compositionend', (event) => +- @editor.revertToCheckpoint(checkpoint) ++ if @checkpointForIME ++ @editor.revertToCheckpoint(@checkpointForIME) ++ @checkpointForIME = null + event.target.value = '' + + # Listen for selection changes and store the currently selected text +@@ -354,6 +356,10 @@ class TextEditorComponent + onTextInput: (event) => + event.stopPropagation() + ++ if @checkpointForIME ++ @editor.revertToCheckpoint(@checkpointForIME) ++ @checkpointForIME = null ++ + # WARNING: If we call preventDefault on the input of a space character, + # then the browser interprets the spacebar keypress as a page-down command, + # causing spaces to scroll elements containing editors. This is impossible |