mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-12 08:58:02 -04:00
node text input: don't remove .
for internal commands
This commit is contained in:
parent
097e7b9174
commit
2868da6070
@ -121,11 +121,13 @@ class NodeTextInputElement(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun updateSuggestion(suggestion: Suggestion) {
|
fun updateSuggestion(suggestion: Suggestion) {
|
||||||
val slash = value.startsWith("/")
|
val prefix = when { // TODO: really dirty dirty hack to not remove the / or . before the command. ChatNode should be responsible for that
|
||||||
var value = SuggestionUtil.apply(value.removePrefix("/"), suggestion)
|
value.startsWith("/") -> "/"
|
||||||
if (slash) {
|
value.startsWith(".") -> "."
|
||||||
value = "/$value" // TODO: dirty hack
|
else -> ""
|
||||||
}
|
}
|
||||||
|
var value = SuggestionUtil.apply(value.removePrefix(prefix), suggestion)
|
||||||
|
value = prefix + value
|
||||||
_set(value)
|
_set(value)
|
||||||
forceApply()
|
forceApply()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user