summaryrefslogtreecommitdiff
path: root/java/org/gnu/emacs/EmacsView.java
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2023-02-19 19:56:51 +0800
committerPo Lu <luangruo@yahoo.com>2023-02-19 19:56:51 +0800
commit0998ab3ade7caf2b163cd99a44b8a3f17be763d5 (patch)
tree32b41d400299eefa5f881e8beaaf7d8ae4f97bfe /java/org/gnu/emacs/EmacsView.java
parent0aa19e993b1603d9cadc47c172f998f4d89b9e49 (diff)
Report both sides of the region to the input method upon setup
* java/org/gnu/emacs/EmacsNative.java (getSelection): Return array of ints. * java/org/gnu/emacs/EmacsView.java (onCreateInputConnection): Adjust accordingly. * src/androidterm.c (struct android_get_selection_context): New field `mark'. (android_get_selection): Set the mark field as appropriate. (getSelection): Adjust accordingly.
Diffstat (limited to 'java/org/gnu/emacs/EmacsView.java')
-rw-r--r--java/org/gnu/emacs/EmacsView.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/java/org/gnu/emacs/EmacsView.java b/java/org/gnu/emacs/EmacsView.java
index 5ea8b0dcc0e..89f526853b2 100644
--- a/java/org/gnu/emacs/EmacsView.java
+++ b/java/org/gnu/emacs/EmacsView.java
@@ -555,7 +555,8 @@ public class EmacsView extends ViewGroup
public InputConnection
onCreateInputConnection (EditorInfo info)
{
- int selection, mode;
+ int mode;
+ int[] selection;
/* Figure out what kind of IME behavior Emacs wants. */
mode = getICMode ();
@@ -575,7 +576,7 @@ public class EmacsView extends ViewGroup
/* If this fails or ANDROID_IC_MODE_NULL was requested, then don't
initialize the input connection. */
- if (selection == -1 || mode == EmacsService.IC_MODE_NULL)
+ if (mode == EmacsService.IC_MODE_NULL || selection == null)
{
info.inputType = InputType.TYPE_NULL;
return null;
@@ -585,8 +586,8 @@ public class EmacsView extends ViewGroup
info.imeOptions |= EditorInfo.IME_ACTION_DONE;
/* Set the initial selection fields. */
- info.initialSelStart = selection;
- info.initialSelEnd = selection;
+ info.initialSelStart = selection[0];
+ info.initialSelEnd = selection[1];
/* Create the input connection if necessary. */