From c7ef305bbc119b820fd619d3ed205198d4f98c3f Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 17 Jan 2014 10:40:05 +0900 Subject: Try to figure out whether d.quotes open or close. Bug: 8911672 Change-Id: I5d5635949530a67f95e5208986907251b7bce903 --- .../com/android/inputmethod/latin/RichInputConnection.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'java/src/com/android/inputmethod/latin/RichInputConnection.java') diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java index 325a0d981..0d0b7a160 100644 --- a/java/src/com/android/inputmethod/latin/RichInputConnection.java +++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java @@ -814,6 +814,17 @@ public final class RichInputConnection { return StringUtils.lastPartLooksLikeURL(mCommittedTextBeforeComposingText); } + /** + * Looks at the text just before the cursor to find out if we are inside a double quote. + * + * As with #textBeforeCursorLooksLikeURL, this is dependent on how much text we have cached. + * However this won't be a concrete problem in most situations, as the cache is almost always + * long enough for this use. + */ + public boolean isInsideDoubleQuoteOrAfterDigit() { + return StringUtils.isInsideDoubleQuoteOrAfterDigit(mCommittedTextBeforeComposingText); + } + /** * Try to get the text from the editor to expose lies the framework may have been * telling us. Concretely, when the device rotates, the frameworks tells us about where the -- cgit v1.2.3-83-g751a