When the content of the textarea contains a multi-byte string, we need to count the characters in the content, not measure the width of the string to determine the cursor position.
By using count(mb_str_split($content)) instead of mb_strwidth($content), we are able to more accurately place the cursor where it belongs whether or not the content contains multi-byte strings.
This PR is a fix for #133.
When the content of the textarea contains a multi-byte string, we need to count the characters in the content, not measure the width of the string to determine the cursor position.
By using
count(mb_str_split($content))
instead ofmb_strwidth($content)
, we are able to more accurately place the cursor where it belongs whether or not the content contains multi-byte strings.