snapWideBounds static method
Snaps (colStart, colEnd) outward across wide-grapheme continuation ("")
cells within [minCol, maxCol].
Implementation
static (int, int) snapWideBounds(
List<String> chars,
int rowOffset,
int colStart,
int colEnd, {
int minCol = 0,
required int maxCol,
}) {
final snappedStart =
colStart > minCol && chars[rowOffset + colStart].isEmpty
? colStart - 1
: colStart;
final snappedEnd = colEnd < maxCol && chars[rowOffset + colEnd + 1].isEmpty
? colEnd + 1
: colEnd;
return (snappedStart, snappedEnd);
}