Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ class AutocompletionHandler(
return@Runnable
}

val completions = ime.getAutocompletions(currentWord, limit = 5)
val result = ime.getAutocompletions(currentWord, limit = 5)

if (completions.isNotEmpty()) {
ime.updateAutocompleteSuggestions(completions)
if (result.completions.isNotEmpty()) {
ime.updateAutocompleteSuggestions(result.completions, result.highlightedSuggestion)
} else {
ime.clearAutocomplete()
}
Expand Down
7 changes: 7 additions & 0 deletions app/src/keyboards/java/be/scri/helpers/SpaceKeyProcessor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ class SpaceKeyProcessor(
* @param wasLastKeySpace true if the previous key pressed was a space.
*/
private fun handleSpaceOutsideCommandBar(wasLastKeySpace: Boolean) {
if (ime.tryInsertHighlightedAutocompleteSuggestion()) {
val wordBeforeSpace = ime.getLastWordBeforeCursor()
suggestionHandler.processLinguisticSuggestions(wordBeforeSpace)
suggestionHandler.processWordSuggestions(wordBeforeSpace)
return
}

val periodOnDoubleTapEnabled = PreferencesHelper.getEnablePeriodOnSpaceBarDoubleTap(context = ime, ime.language)
val ic = ime.currentInputConnection ?: return
val wordBeforeSpace = ime.getLastWordBeforeCursor()
Expand Down
Loading
Loading