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.
This commit is contained in:
@@ -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. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user