Solve bad name reference error

This commit is contained in:
Angela Mazzurco 2017-07-01 17:02:32 +02:00
parent f975f340a4
commit b38c944484

View File

@ -55,11 +55,11 @@ Rectangle {
//checks if the previous character is an Emoji and adds a ' ' if that's the case
//this is necessary, because Emoji use a bigger font-size, and that font-size is kept using without a ' '
function keyPressedHandler(event) {
var testStr = txtIn.getText(txtIn.length-2, txtIn.length)
var testStr = textArea.getText(textArea.length-2, textArea.length)
var ptrn = new RegExp("[\uD800-\uDBFF][\uDC00-\uDFFF]")
if ((event.key !== Qt.Key_Backspace) && (ptrn.test(testStr))) {
txtIn.text += " "
txtIn.cursorPosition = txtIn.length
textArea.text += " "
textArea.cursorPosition = textArea.length
}
}