diff --git a/MLEM/Font/CodePointSource.cs b/MLEM/Font/CodePointSource.cs index cae77b2..9133e81 100644 --- a/MLEM/Font/CodePointSource.cs +++ b/MLEM/Font/CodePointSource.cs @@ -71,7 +71,7 @@ namespace MLEM.Font { /// An index close to , but not between surrogates. public int EnsureSurrogateBoundary(int index, bool increase) { if (index < this.Length && char.IsLowSurrogate(this[index])) - return increase && index < this.Length - 1 || index <= 0 ? index + 1 : index - 1; + return increase || index <= 0 ? index + 1 : index - 1; return index; } diff --git a/MLEM/Input/TextInput.cs b/MLEM/Input/TextInput.cs index 2061b05..45ce6fb 100644 --- a/MLEM/Input/TextInput.cs +++ b/MLEM/Input/TextInput.cs @@ -419,7 +419,7 @@ namespace MLEM.Input { this.CaretPos = destStart + destAccum.Length; return true; } - destAccum += this.text[destStart + destAccum.Length]; + destAccum += CodePointSource.ToString(new CodePointSource(this.text).GetCodePoint(destStart + destAccum.Length).CodePoint); } // if we don't find a proper position, just move to the end of the destination line this.CaretPos = destEnd;