Hey all,
I have this weird problem that I think might be a bug but I can't be sure. I have this
BasicTextField
that has a visual transformation applied to it that transforms
# Title
to
Title
and changes the size of the text (markdown). It constructs a
TransformedText
object with an
OffsetMapping
to account for the 2 characters that have been removed. However there seems to be a bug because when I type in
# Title
it gets transformed to
Title
in the text field however when I move the cursor using the arrow keys to the end of the line the application crashes with an out of bounds error. I traced this down and it looks like its an issue with the
isLtr()
function as it uses
selection.end
without performing a
OffsetMapping
conversion on it.
// TextPreparedSelection.kt
private fun isLtr(): Boolean {
val direction = layoutResult?.getParagraphDirection(selection.end)
return direction != ResolvedTextDirection.Rtl
}
Any ideas on how I could resolve this issue?