|
|
|
@ -383,10 +383,9 @@ class Line extends Container<Leaf?> { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Returns each node segment's offset in selection |
|
|
|
|
/// Returns each node segment's length in selection |
|
|
|
|
/// with its corresponding style as a list |
|
|
|
|
List<Tuple2<int, Style>> collectAllIndividualStyles(int offset, int len, |
|
|
|
|
{int beg = 0}) { |
|
|
|
|
List<Tuple2<int, Style>> collectAllIndividualStyles(int offset, int len) { |
|
|
|
|
final local = math.min(length - offset, len); |
|
|
|
|
final result = <Tuple2<int, Style>>[]; |
|
|
|
|
|
|
|
|
@ -394,7 +393,7 @@ class Line extends Container<Leaf?> { |
|
|
|
|
var node = data.node as Leaf?; |
|
|
|
|
if (node != null) { |
|
|
|
|
var pos = node.length - data.offset; |
|
|
|
|
result.add(Tuple2(pos + beg, node.style)); |
|
|
|
|
result.add(Tuple2(pos, node.style)); |
|
|
|
|
while (!node!.isLast && pos < local) { |
|
|
|
|
node = node.next as Leaf; |
|
|
|
|
result.add(Tuple2(node.length, node.style)); |
|
|
|
@ -406,8 +405,7 @@ class Line extends Container<Leaf?> { |
|
|
|
|
|
|
|
|
|
final remaining = len - local; |
|
|
|
|
if (remaining > 0) { |
|
|
|
|
final rest = |
|
|
|
|
nextLine!.collectAllIndividualStyles(0, remaining, beg: local); |
|
|
|
|
final rest = nextLine!.collectAllIndividualStyles(0, remaining); |
|
|
|
|
result.addAll(rest); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|