diff options
| author | Jules Aguillon | 2026-04-12 14:33:27 +0200 |
|---|---|---|
| committer | GitHub | 2026-04-12 14:33:27 +0200 |
| commit | a1d0342033460a13407deb27cac3ed5ad13ab47f (patch) | |
| tree | 0724c2407f23f94f7803494294ddd24f92f90237 /srcs/juloo.keyboard2/EditorConfig.java | |
| parent | 5ec663c306907a32d21c910dc6df69d11b7ab243 (diff) | |
| download | unexpected-keyboard-a1d0342033460a13407deb27cac3ed5ad13ab47f.tar.gz unexpected-keyboard-a1d0342033460a13407deb27cac3ed5ad13ab47f.zip | |
Better spell check with cursor in the middle of a word (#1233)
* Better spell check with cursor in the middle of a word
Suggestions are based on the entire word and no longer the part of the
word just before the cursor. Also, tapping a suggestion or the space bar
autocorrect replaces the entire word.
* Reduce the number of calls to refresh_current_word
While the cursor moves, calls to refresh_current_word are now only done
when the cursor exits the current word.
Diffstat (limited to 'srcs/juloo.keyboard2/EditorConfig.java')
| -rw-r--r-- | srcs/juloo.keyboard2/EditorConfig.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/srcs/juloo.keyboard2/EditorConfig.java b/srcs/juloo.keyboard2/EditorConfig.java index a198775..fa6a9dd 100644 --- a/srcs/juloo.keyboard2/EditorConfig.java +++ b/srcs/juloo.keyboard2/EditorConfig.java @@ -32,6 +32,7 @@ public final class EditorConfig /** CurrentlyTypedWord. */ public CharSequence initial_text_before_cursor = null; // Might be [null]. + public CharSequence initial_text_after_cursor = null; // Might be [null]. public int initial_sel_start; public int initial_sel_end; @@ -92,7 +93,10 @@ public final class EditorConfig caps_initially_updated = caps_should_update_state(info); /* CurrentlyTypedWord */ if (VERSION.SDK_INT >= 30) - initial_text_before_cursor = info.getInitialTextBeforeCursor(10, 0); + { + initial_text_before_cursor = info.getInitialTextBeforeCursor(20, 0); + initial_text_after_cursor = info.getInitialTextAfterCursor(20, 0); + } initial_sel_start = info.initialSelStart; initial_sel_end = info.initialSelEnd; /* Suggestions */ |
