codeUnitsRowColumn as companion to rowColumnCodeUnits
alanz opened this issue · comments
We have
rowColumnCodeUnits :: RowColumn -> Rope -> Int
Can we have the inverse
codeUnitsRowColumn :: Int -> Rope -> RowColumn
It looks like it should be some combination of splitAt
and measure
And it seems that what I am looking for is
codeUnitsRowColumn :: Int -> Rope ->RowColumn
codeUnitsRowColumn offset rope = rowColumn . measure . fst $ splitAt offset rope
Sounds good. Wanna create a PR with that?