diff options
| author | Jules Aguillon | 2026-04-10 19:03:20 +0200 |
|---|---|---|
| committer | GitHub | 2026-04-10 19:03:20 +0200 |
| commit | f29ae92ba7b5567429c9132afaa4353282c85abe (patch) | |
| tree | 13eec49f7b03c77f84597700a7d922fa018ba866 /srcs/juloo.keyboard2 | |
| parent | 5f63214c0821368a7fa598c565ad24bdac1b4dd0 (diff) | |
| download | unexpected-keyboard-f29ae92ba7b5567429c9132afaa4353282c85abe.tar.gz unexpected-keyboard-f29ae92ba7b5567429c9132afaa4353282c85abe.zip | |
Disable spacebar autocomplete when suggestions are hidden (#1227)
The spacebar autocomplete option was still working even when the
suggestions strip was correctly hidden in applications like Termux.
Diffstat (limited to 'srcs/juloo.keyboard2')
| -rw-r--r-- | srcs/juloo.keyboard2/KeyEventHandler.java | 1 | ||||
| -rw-r--r-- | srcs/juloo.keyboard2/suggestions/Suggestions.java | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/srcs/juloo.keyboard2/KeyEventHandler.java b/srcs/juloo.keyboard2/KeyEventHandler.java index d078a63..1418ebb 100644 --- a/srcs/juloo.keyboard2/KeyEventHandler.java +++ b/srcs/juloo.keyboard2/KeyEventHandler.java @@ -50,6 +50,7 @@ public final class KeyEventHandler InputConnection ic = _recv.getCurrentInputConnection(); _autocap.started(conf, ic); _typedword.started(conf, ic); + _suggestions.started(); _move_cursor_force_fallback = conf.editor_config.should_move_cursor_force_fallback; _space_bar_auto_complete = conf.space_bar_auto_complete; diff --git a/srcs/juloo.keyboard2/suggestions/Suggestions.java b/srcs/juloo.keyboard2/suggestions/Suggestions.java index 4417470..638ac64 100644 --- a/srcs/juloo.keyboard2/suggestions/Suggestions.java +++ b/srcs/juloo.keyboard2/suggestions/Suggestions.java @@ -12,6 +12,7 @@ public final class Suggestions { Callback _callback; Config _config; + boolean _enabled; /** The suggestion displayed at the center of the candidates view and entered by the space bar. */ @@ -23,8 +24,16 @@ public final class Suggestions _config = conf; } + public void started() + { + _enabled = _config.editor_config.should_show_candidates_view; + best_suggestion = null; + } + public void currently_typed_word(String word) { + if (!_enabled) + return; Cdict dict = _config.current_dictionary; if (word.length() < 2 || dict == null) { |
