countRevealCharacters function

int countRevealCharacters(
  1. List<InlineSpan> spans
)

Total characters in spans, counting a placeholder as one.

This is the unit the reveal counts in, so it has to agree exactly with what applyReveal walks — hence one function, used by both.

Implementation

int countRevealCharacters(List<InlineSpan> spans) {
  var total = 0;
  for (final span in spans) {
    total += _count(span);
  }
  return total;
}