From 9a958c59a2ce546e6ec99c58ca181dafeac8dd6b Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 1 Jun 2023 10:05:42 +0800 Subject: [PATCH] Update Android port * java/org/gnu/emacs/EmacsInputConnection.java (EmacsInputConnection): Add compatibility adjustments for Samsung devices. --- java/org/gnu/emacs/EmacsInputConnection.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/java/org/gnu/emacs/EmacsInputConnection.java b/java/org/gnu/emacs/EmacsInputConnection.java index 420da58c0f8..54c98d950aa 100644 --- a/java/org/gnu/emacs/EmacsInputConnection.java +++ b/java/org/gnu/emacs/EmacsInputConnection.java @@ -65,6 +65,13 @@ public final class EmacsInputConnection extends BaseInputConnection if (Build.MANUFACTURER.equalsIgnoreCase ("Huawei") || Build.MANUFACTURER.equalsIgnoreCase ("Honor")) extractAbsoluteOffsets = syncAfterCommit = true; + + /* The Samsung keyboard takes `selectionStart' at face value if + some text is returned, and also searches for words solely + within that text. However, when no text is returned, it falls + back to getTextAfterCursor and getTextBeforeCursor. */ + if (Build.MANUFACTURER.equalsIgnoreCase ("Samsung")) + extractAbsoluteOffsets = true; }; public -- 2.39.2