diff --git a/core/src/com/unciv/ui/options/MultiplayerTab.kt b/core/src/com/unciv/ui/options/MultiplayerTab.kt index 4d72af1f59..55acf17b94 100644 --- a/core/src/com/unciv/ui/options/MultiplayerTab.kt +++ b/core/src/com/unciv/ui/options/MultiplayerTab.kt @@ -238,29 +238,15 @@ private fun fixTextFieldUrlOnType(TextField: TextField) { var text: String = TextField.text var cursor: Int = minOf(TextField.cursorPosition, text.length) - // if text is 'http:' or 'https:' auto append '//' - if (Regex("^https?:$").containsMatchIn(text)) { - TextField.appendText("//") - return - } - val textBeforeCursor: String = text.substring(0, cursor) - // replace multiple slash with a single one - val multipleSlashes = Regex("/{2,}") + // replace multiple slash with a single one, except when it's a :// + val multipleSlashes = Regex("(? 'https:/' - // fix that if available and update cursor - val i: Int = text.indexOf(":/") - if (i > -1) { - text = text.replaceRange(i..i + 1, "://") - if (cursor > i + 1) ++cursor - } - // update TextField if (text != TextField.text) { TextField.text = text