Make TextInputPanel obey acceptsCharacter when pasting from clipboard
This commit is contained in:
parent
9fe8d1734e
commit
9394de61d9
@ -894,7 +894,7 @@ open class TextInputPanel<out S : Screen>(
|
||||
pushbackSnapshot()
|
||||
|
||||
if (multiLine) {
|
||||
val insert = minecraft.keyboardHandler.clipboard.replace("\t", " ").split(NEWLINES).toMutableList()
|
||||
val insert = minecraft.keyboardHandler.clipboard.replace("\t", " ").filter { acceptsCharacter(it) }.split(NEWLINES).toMutableList()
|
||||
val actualLastSize = insert.lastOrNull()?.length ?: 0
|
||||
val line = this[cursorLine]
|
||||
|
||||
@ -933,7 +933,7 @@ open class TextInputPanel<out S : Screen>(
|
||||
cursorRow = actualLastSize
|
||||
}
|
||||
} else {
|
||||
val insert = minecraft.keyboardHandler.clipboard.replace("\t", " ").replace(NEWLINES, "")
|
||||
val insert = minecraft.keyboardHandler.clipboard.replace("\t", " ").replace(NEWLINES, "").filter { acceptsCharacter(it) }
|
||||
val line = this[cursorLine]
|
||||
|
||||
if (line == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user