mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Fix an issue with dragging debug action
This commit is contained in:
parent
657203e733
commit
b74e977b6a
@ -21,7 +21,8 @@ val AllActions = listOf(
|
||||
VoiceInputAction,
|
||||
SystemVoiceInputAction,
|
||||
SwitchLanguageAction,
|
||||
ClipboardHistoryAction
|
||||
ClipboardHistoryAction,
|
||||
MemoryDebugAction
|
||||
)
|
||||
|
||||
|
||||
@ -42,8 +43,8 @@ object ActionRegistry {
|
||||
return actions.map { AllActions.indexOf(it) }.joinToString(separator = ",")
|
||||
}
|
||||
|
||||
fun moveElement(string: String, action: Action, direction: Int): String {
|
||||
val actions = stringToActions(string, listOf())
|
||||
fun moveElement(string: String, defaults: List<Action>, action: Action, direction: Int): String {
|
||||
val actions = stringToActions(string, defaults)
|
||||
val index = actions.indexOf(action)
|
||||
val filtered = actions.filter { it != action }.toMutableList()
|
||||
filtered.add((index + direction).coerceIn(0 .. filtered.size), action)
|
||||
|
Loading…
Reference in New Issue
Block a user