History command no longer breaks on autocomplete sometimes

This commit is contained in:
Yair Morgenstern 2024-06-10 22:19:21 +03:00
parent c0cec548e0
commit be3260d770
2 changed files with 6 additions and 8 deletions

View File

@ -37,6 +37,7 @@ internal open class ConsoleAction(
val formatParams = format.split(' ').drop(2).map {
it.removeSurrounding("<",">").removeSurrounding("[","]").removeSurrounding("\"")
}
if (formatParams.none()) return null // nothing to autocomplete - for example "history " + tab
if (formatParams.size < params.size) return null // format has no definition, so there are no options to choose from
// It is possible we're here *with* another format parameter but an *empty* params (e.g. `tile addriver` and hit tab) -> see below
val (formatParam, lastParam) = if (params.lastIndex in formatParams.indices)

View File

@ -575,14 +575,6 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Global, FollowerBelief
??? example "Provides a sum of gold each time you spend a Great Person"
Applicable to: Global
??? example "[stats] whenever a Great Person is expended"
Example: "[+1 Gold, +2 Production] whenever a Great Person is expended"
Applicable to: Global
??? example "[relativeAmount]% Gold from Great Merchant trade missions"
Example: "[+20]% Gold from Great Merchant trade missions"
@ -2389,6 +2381,11 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: UnitTriggerCondition
??? example "&lt;upon expending a [mapUnitFilter] unit&gt;"
Example: "&lt;upon expending a [Wounded] unit&gt;"
Applicable to: UnitTriggerCondition
??? example "&lt;upon being defeated&gt;"
Applicable to: UnitTriggerCondition